@@ -113,8 +113,7 @@ public DefaultBHttpClientConnection(
113
113
DefaultContentLengthStrategy .INSTANCE ;
114
114
this .outgoingContentStrategy = outgoingContentStrategy != null ? outgoingContentStrategy :
115
115
DefaultContentLengthStrategy .INSTANCE ;
116
- this .responseOutOfOrderStrategy = responseOutOfOrderStrategy != null ? responseOutOfOrderStrategy :
117
- NoResponseOutOfOrderStrategy .INSTANCE ;
116
+ this .responseOutOfOrderStrategy = responseOutOfOrderStrategy ;
118
117
this .consistent = true ;
119
118
}
120
119
@@ -220,21 +219,27 @@ void checkForEarlyResponse(final long totalBytesSent, final int nextWriteSize) t
220
219
221
220
@ Override
222
221
public void write (final byte [] b ) throws IOException {
223
- checkForEarlyResponse (totalBytes , b .length );
222
+ if (responseOutOfOrderStrategy != null ) {
223
+ checkForEarlyResponse (totalBytes , b .length );
224
+ }
224
225
totalBytes += b .length ;
225
226
socketOutputStream .write (b );
226
227
}
227
228
228
229
@ Override
229
230
public void write (final byte [] b , final int off , final int len ) throws IOException {
230
- checkForEarlyResponse (totalBytes , len );
231
+ if (responseOutOfOrderStrategy != null ) {
232
+ checkForEarlyResponse (totalBytes , len );
233
+ }
231
234
totalBytes += len ;
232
235
socketOutputStream .write (b , off , len );
233
236
}
234
237
235
238
@ Override
236
239
public void write (final int b ) throws IOException {
237
- checkForEarlyResponse (totalBytes , 1 );
240
+ if (responseOutOfOrderStrategy != null ) {
241
+ checkForEarlyResponse (totalBytes , 1 );
242
+ }
238
243
totalBytes ++;
239
244
socketOutputStream .write (b );
240
245
}
0 commit comments