hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1231506 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
Date Sat, 14 Jan 2012 14:22:45 GMT
Author: olegk
Date: Sat Jan 14 14:22:45 2012
New Revision: 1231506

URL: http://svn.apache.org/viewvc?rev=1231506&view=rev
Log:
HTTPCORE-289: Cancellable#cancel() not invoked when connection is put to a half-closed state

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.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=1231506&r1=1231505&r2=1231506&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
Sat Jan 14 14:22:45 2012
@@ -232,6 +232,9 @@ public class HttpAsyncService implements
             final NHttpServerConnection conn) throws IOException, HttpException {
         State state = ensureNotNull(getState(conn));
         synchronized (state) {
+            if (state.getResponseState() != MessageState.READY) {
+                throw new ProtocolException("Out of sequence request message detected (pipelining
is not supported)");
+            }
             HttpRequest request = conn.getHttpRequest();
             HttpContext context = state.getContext();
             request.setParams(new DefaultedHttpParams(request.getParams(), this.params));
@@ -742,6 +745,7 @@ public class HttpAsyncService implements
                 if (this.state.isTerminated() && cancellable != null) {
                     cancellable.cancel();
                 } else {
+                    this.conn.requestInput();
                     this.state.setCancellable(cancellable);
                 }
             }



Mime
View raw message