jira-importer opened a new issue, #1423:
URL: https://github.com/apache/httpcomponents-core/issues/1423

   **[Tom 
Fitzhenry](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=tomfitzhenry)**
 opened 
**[HTTPCORE-422](https://issues.apache.org/jira/browse/HTTPCORE-422?redirect=false)**
 and commented
   
   HttpAsyncRequestExecutor#responseReceived(NHttpClientConnection) calls 
HttpAsyncResponseConsumer#responseReceived(HttpResponse) via 
HttpAsyncClientExchangeHandler#responseReceived(HttpResponse).
   
   See 
https://github.com/apache/httpcore/blob/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java#L302
 .
   
   It does this even if the request is a HEAD request. If your 
HttpAsyncResponseConsumer is a BasicAsyncResponseConsumer, then this will 
allocate a buffer of size content-length kB (or 4kB, if content-length does not 
exist).
   
   For a simple proxying Java app, profiling revealed this the allocation due 
to this was a bottleneck.
   
   It'd be nice if
   
   Are there use cases for calling 
HttpAsyncResponseConsumer#responseReceived(HttpResponse) on HEAD requests? If 
not, perhaps it could not be called.
   
   FWIW, it looks like httpclient doe not call the corresponding method for 
HEAD requests: 
https://github.com/apache/httpcore/blob/4.4.x/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java#L273-L275
   
   
   ---
   
   **Affects:** 4.4.5
   
   **Backported to:** 
[4.4.6](https://github.com/apache/httpcomponents-core/milestone/43?closed=1)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to