hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Potapov <potapo...@gmail.com>
Subject Three different HttpContext in HttpAsyncService
Date Mon, 06 Oct 2014 07:35:00 GMT
Hello everyone,

Until today I was under a misapprehension that there is single HttpContext
travels across handlers and callbacks during request processing. Today I've
discovered that during single request processing HttpAsyncService can operate
with three different HttpContext:
 1. BasicHttpContext created in .requestReceived(). This context will have
    HTTP_RESPONSE and HTTP_CONNECTION attributes.
 2. BasicHttpContext created in .exception(). In case of HttpException thrown
    from HttpAsyncRequestHandler.handle() function, this context will be empty.
 3. SessionHttpContext created by NHttpConnectionBase.setSession(). This
    context will be passed to ConnectionReuseStrategy.keepAlive() and will have
    HTTP_CONNECTION set, but no HTTP_RESPONSE.

Is this contexts separation is intentional and there are some reasons to have
them separated and containing different set off attributes?
As for me, it seems reasonable to use NHttpConnection.getContext() in all three
cases listed above. Which pitfalls I'm missing here?

-- 
Best regards,
Dmitry Potapov

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


Mime
View raw message