hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1783927 - /httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
Date Tue, 21 Feb 2017 19:58:24 GMT
Author: olegk
Date: Tue Feb 21 19:58:24 2017
New Revision: 1783927

URL: http://svn.apache.org/viewvc?rev=1783927&view=rev
Log:
Fixed request state tracking in HTTP/1.1 client stream handler

Modified:
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java?rev=1783927&r1=1783926&r2=1783927&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamHandler.java
Tue Feb 21 19:58:24 2017
@@ -116,7 +116,7 @@ class ClientHttp1StreamHandler implement
         this.inputBuffer = inputBuffer;
         this.requestCommitted = new AtomicBoolean(false);
         this.done = new AtomicBoolean(false);
-        this.requestState = MessageState.HEADERS;
+        this.requestState = MessageState.IDLE;
         this.responseState = MessageState.HEADERS;
     }
 
@@ -139,7 +139,7 @@ class ClientHttp1StreamHandler implement
 
     boolean isOutputReady() {
         switch (requestState) {
-            case HEADERS:
+            case IDLE:
             case ACK:
                 return true;
             case BODY:
@@ -188,7 +188,8 @@ class ClientHttp1StreamHandler implement
 
     void produceOutput() throws HttpException, IOException {
         switch (requestState) {
-            case HEADERS:
+            case IDLE:
+                requestState = MessageState.HEADERS;
                 exchangeHandler.produceRequest(new RequestChannel() {
 
                     @Override



Mime
View raw message