hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1748975 - /httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
Date Sat, 18 Jun 2016 12:16:56 GMT
Author: olegk
Date: Sat Jun 18 12:16:56 2016
New Revision: 1748975

URL: http://svn.apache.org/viewvc?rev=1748975&view=rev
Log:
HTTPCORE-422: HttpAsyncResponseConsumer#onEntityEnclosed is triggered for HEAD responses

Modified:
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java?rev=1748975&r1=1748974&r2=1748975&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
(original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
Sat Jun 18 12:16:56 2016
@@ -300,11 +300,12 @@ public class HttpAsyncRequestExecutor im
             state.invalidate();
         }
 
-        handler.responseReceived(response);
-
-        state.setResponseState(MessageState.BODY_STREAM);
-        if (!canResponseHaveBody(request, response)) {
+        if (canResponseHaveBody(request, response)) {
+            handler.responseReceived(response);
+            state.setResponseState(MessageState.BODY_STREAM);
+        } else {
             response.setEntity(null);
+            handler.responseReceived(response);
             conn.resetInput();
             processResponse(conn, state, handler);
         }



Mime
View raw message