You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/04/28 15:08:38 UTC

svn commit: r1590623 - in /httpcomponents/httpcore/trunk/httpcore-nio/src: main/java/org/apache/http/nio/protocol/HttpAsyncService.java test/java/org/apache/http/nio/protocol/TestHttpAsyncService.java

Author: olegk
Date: Mon Apr 28 13:08:37 2014
New Revision: 1590623

URL: http://svn.apache.org/r1590623
Log:
HTTPCORE-379: shut down non-blocking server side connection in case of an i/o or runtime error to avoid an infinite loop in the i/o reactor trying to flush buffered output
Contributed by Dmitry Potapov <potapov.d at gmail.com>

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncService.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java?rev=1590623&r1=1590622&r2=1590623&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java Mon Apr 28 13:08:37 2014
@@ -247,7 +247,7 @@ public class HttpAsyncService implements
                 || state.getResponseState().compareTo(MessageState.INIT) > 0) {
             // There is not much that we can do if a response
             // has already been submitted or pipelining is being used.
-            closeConnection(conn);
+            shutdownConnection(conn);
         } else {
             try {
                 final Incoming incoming = state.getIncoming();

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncService.java?rev=1590623&r1=1590622&r2=1590623&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncService.java Mon Apr 28 13:08:37 2014
@@ -282,7 +282,7 @@ public class TestHttpAsyncService {
 
         Assert.assertEquals(MessageState.READY, state.getRequestState());
         Assert.assertEquals(MessageState.READY, state.getResponseState());
-        Mockito.verify(this.conn).close();
+        Mockito.verify(this.conn).shutdown();
         Mockito.verify(this.requestConsumer).failed(httpex);
         Mockito.verify(this.requestConsumer).close();
         Mockito.verify(this.responseProducer).failed(httpex);