hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Leigh (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HTTPCORE-351) BasicHttpContext#clear() Should Not Be Used
Date Wed, 25 Sep 2013 16:00:03 GMT

     [ https://issues.apache.org/jira/browse/HTTPCORE-351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

James Leigh updated HTTPCORE-351:

    Attachment: HTTPCORE-351.patch

This patch allows the previous context to still be used after the exchange is complete. Sebsequent
requests will use a different context. This way the context object is not shared between requests.

-  this.context.clear();
+  this.context = new BasicHttpContext();

> BasicHttpContext#clear() Should Not Be Used
> -------------------------------------------
>                 Key: HTTPCORE-351
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-351
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.2.5, 4.3
>            Reporter: James Leigh
>             Fix For: 4.3.1
>         Attachments: HTTPCORE-351.patch
> HttpAsyncService.State.reset() should not call clear(), but instead initialize a new
(empty) context object for use with sequent requests.
> Since HttpCore-nio is expected to be used in a multi-threaded environment, there is not
guarantee that when exchange is over, the request/response is not still being processed (in
another thread). Consider the situation when the client closes the TCP connection before the
response is complete or when the response headers are ready, but the response entity is still
being produced. In these situations clearing the HttpContext may have adverse effects in other
threads that are still processing the request/response.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message