hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Berlin" <sber...@gmail.com>
Subject Timing of HttpProcessor.process w/ ClientHandlers
Date Wed, 04 Jun 2008 18:54:56 GMT
Hi Folks,

I'm starting to get into using the client side of httpcore-nio, and am
using AsyncNHttpClientHandler w/ NHttpRequestExecutionHandler.

One thing I'm finding slightly odd is the order that way the handlers
& processors are notified of incoming responses.  The order right now

  1) NHttpRequestExecutionHandler.responseEntity [if an entity exists]
  2) HttpProcessor.process [after entity consuming completes]
  3) NHttpRequestExecutionHandler.handleResponse

I'd like to shift the the HttpProcessor.process to be first, so that
headers in the response can be processed & analyzed before the entity
is fully consumed.  Currently, when HttpProcess.process is called on a
response, the entity exists within the response and can be gotten &
parsed.  This would change that, so the entity cannot be *read* in the
processor.  (It could still be analyzed for size, content-type, etc..)

This enables header interceptors to work on entities who fail to read
the entire message.  It also enables interceptors to work earlier on
messages that have very long bodies.  It does prevent interceptors
from looking at the contents of the entity, though.

If folks think this is OK, I'll whip up a patch.


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

View raw message