@@ -8,11 +8,11 @@ namespace Elasticsearch.Net
88 public class Transport < TConnectionSettings > : ITransport < TConnectionSettings >
99 where TConnectionSettings : IConnectionConfigurationValues
1010 {
11- //TODO should all of these be public?
1211 public TConnectionSettings Settings { get ; }
13- public IDateTimeProvider DateTimeProvider { get ; }
14- public IMemoryStreamFactory MemoryStreamFactory { get ; }
15- public IRequestPipelineFactory PipelineProvider { get ; }
12+
13+ private IDateTimeProvider DateTimeProvider { get ; }
14+ private IMemoryStreamFactory MemoryStreamFactory { get ; }
15+ private IRequestPipelineFactory PipelineProvider { get ; }
1616
1717 /// <summary>
1818 /// Transport coordinates the client requests over the connection pool nodes and is in charge of falling over on different nodes
@@ -43,7 +43,7 @@ IMemoryStreamFactory memoryStreamFactory
4343
4444 this . Settings = configurationValues ;
4545 this . PipelineProvider = pipelineProvider ?? new RequestPipelineFactory ( ) ;
46- this . DateTimeProvider = dateTimeProvider ?? Net . DateTimeProvider . Default ;
46+ this . DateTimeProvider = dateTimeProvider ?? Elasticsearch . Net . DateTimeProvider . Default ;
4747 this . MemoryStreamFactory = memoryStreamFactory ?? new MemoryStreamFactory ( ) ;
4848 }
4949
@@ -93,11 +93,9 @@ public ElasticsearchResponse<TReturn> Request<TReturn>(HttpMethod method, string
9393 AuditTrail = pipeline ? . AuditTrail
9494 } ;
9595 }
96- if ( response != null && response . SuccessOrKnownError )
97- {
98- pipeline . MarkAlive ( node ) ;
99- break ;
100- }
96+ if ( response == null || ! response . SuccessOrKnownError ) continue ;
97+ pipeline . MarkAlive ( node ) ;
98+ break ;
10199 }
102100 if ( response == null || ! response . Success )
103101 pipeline . BadResponse ( ref response , requestData , seenExceptions ) ;
@@ -154,11 +152,9 @@ public async Task<ElasticsearchResponse<TReturn>> RequestAsync<TReturn>(HttpMeth
154152 AuditTrail = pipeline . AuditTrail
155153 } ;
156154 }
157- if ( response != null && response . SuccessOrKnownError )
158- {
159- pipeline . MarkAlive ( node ) ;
160- break ;
161- }
155+ if ( response == null || ! response . SuccessOrKnownError ) continue ;
156+ pipeline . MarkAlive ( node ) ;
157+ break ;
162158 }
163159 if ( response == null || ! response . Success )
164160 pipeline . BadResponse ( ref response , requestData , seenExceptions ) ;
0 commit comments