@@ -369,7 +369,7 @@ private Channel lookupInCache(URI uri, ConnectionPoolKeyStrategy connectionPoolK
369369
370370 try {
371371 // 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
373373 // https.
374374 return verifyChannelPipeline (channel , uri .getScheme ());
375375 } catch (Exception ex ) {
@@ -792,10 +792,10 @@ else if (uri.getRawQuery() != null)
792792 }
793793
794794 } else if (request .getParts () != null ) {
795- int lenght = computeAndSetContentLength (request , nettyRequest );
795+ int length = computeAndSetContentLength (request , nettyRequest );
796796
797- if (lenght == -1 ) {
798- lenght = MAX_BUFFERED_BYTES ;
797+ if (length == -1 ) {
798+ length = MAX_BUFFERED_BYTES ;
799799 }
800800
801801 MultipartRequestEntity mre = AsyncHttpProviderUtils .createMultipartRequestEntity (request .getParts (), request .getHeaders ());
@@ -808,18 +808,18 @@ else if (uri.getRawQuery() != null)
808808 */
809809
810810 if (isSecure (uri )) {
811- ChannelBuffer b = ChannelBuffers .dynamicBuffer (lenght );
811+ ChannelBuffer b = ChannelBuffers .dynamicBuffer (length );
812812 mre .writeRequest (new ChannelBufferOutputStream (b ));
813813 nettyRequest .setContent (b );
814814 }
815815 } else if (request .getEntityWriter () != null ) {
816- int lenght = computeAndSetContentLength (request , nettyRequest );
816+ int length = computeAndSetContentLength (request , nettyRequest );
817817
818- if (lenght == -1 ) {
819- lenght = MAX_BUFFERED_BYTES ;
818+ if (length == -1 ) {
819+ length = MAX_BUFFERED_BYTES ;
820820 }
821821
822- ChannelBuffer b = ChannelBuffers .dynamicBuffer (lenght );
822+ ChannelBuffer b = ChannelBuffers .dynamicBuffer (length );
823823 request .getEntityWriter ().writeEntity (new ChannelBufferOutputStream (b ));
824824 nettyRequest .setHeader (HttpHeaders .Names .CONTENT_LENGTH , b .writerIndex ());
825825 nettyRequest .setContent (b );
@@ -1015,10 +1015,7 @@ private <T> ListenableFuture<T> doConnect(final Request request, final AsyncHand
10151015 return c .future ();
10161016 }
10171017
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 ());
10221019
10231020 if (directInvokation && !asyncConnect && request .getFile () == null ) {
10241021 int timeOut = config .getConnectionTimeoutInMs () > 0 ? config .getConnectionTimeoutInMs () : Integer .MAX_VALUE ;
0 commit comments