@@ -369,7 +369,7 @@ private Channel lookupInCache(URI uri, ConnectionPoolKeyStrategy connectionPoolK
369
369
370
370
try {
371
371
// Always make sure the channel who got cached support the proper protocol. It could
372
- // only occurs when a HttpMethod.CONNECT is used agains a proxy that require upgrading from http to
372
+ // only occurs when a HttpMethod.CONNECT is used against a proxy that require upgrading from http to
373
373
// https.
374
374
return verifyChannelPipeline (channel , uri .getScheme ());
375
375
} catch (Exception ex ) {
@@ -792,10 +792,10 @@ else if (uri.getRawQuery() != null)
792
792
}
793
793
794
794
} else if (request .getParts () != null ) {
795
- int lenght = computeAndSetContentLength (request , nettyRequest );
795
+ int length = computeAndSetContentLength (request , nettyRequest );
796
796
797
- if (lenght == -1 ) {
798
- lenght = MAX_BUFFERED_BYTES ;
797
+ if (length == -1 ) {
798
+ length = MAX_BUFFERED_BYTES ;
799
799
}
800
800
801
801
MultipartRequestEntity mre = AsyncHttpProviderUtils .createMultipartRequestEntity (request .getParts (), request .getHeaders ());
@@ -808,18 +808,18 @@ else if (uri.getRawQuery() != null)
808
808
*/
809
809
810
810
if (isSecure (uri )) {
811
- ChannelBuffer b = ChannelBuffers .dynamicBuffer (lenght );
811
+ ChannelBuffer b = ChannelBuffers .dynamicBuffer (length );
812
812
mre .writeRequest (new ChannelBufferOutputStream (b ));
813
813
nettyRequest .setContent (b );
814
814
}
815
815
} else if (request .getEntityWriter () != null ) {
816
- int lenght = computeAndSetContentLength (request , nettyRequest );
816
+ int length = computeAndSetContentLength (request , nettyRequest );
817
817
818
- if (lenght == -1 ) {
819
- lenght = MAX_BUFFERED_BYTES ;
818
+ if (length == -1 ) {
819
+ length = MAX_BUFFERED_BYTES ;
820
820
}
821
821
822
- ChannelBuffer b = ChannelBuffers .dynamicBuffer (lenght );
822
+ ChannelBuffer b = ChannelBuffers .dynamicBuffer (length );
823
823
request .getEntityWriter ().writeEntity (new ChannelBufferOutputStream (b ));
824
824
nettyRequest .setHeader (HttpHeaders .Names .CONTENT_LENGTH , b .writerIndex ());
825
825
nettyRequest .setContent (b );
@@ -1015,10 +1015,7 @@ private <T> ListenableFuture<T> doConnect(final Request request, final AsyncHand
1015
1015
return c .future ();
1016
1016
}
1017
1017
1018
- boolean directInvokation = true ;
1019
- if (IN_IO_THREAD .get () && DefaultChannelFuture .isUseDeadLockChecker ()) {
1020
- directInvokation = false ;
1021
- }
1018
+ boolean directInvokation = !(IN_IO_THREAD .get () && DefaultChannelFuture .isUseDeadLockChecker ());
1022
1019
1023
1020
if (directInvokation && !asyncConnect && request .getFile () == null ) {
1024
1021
int timeOut = config .getConnectionTimeoutInMs () > 0 ? config .getConnectionTimeoutInMs () : Integer .MAX_VALUE ;
0 commit comments