hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HTTPCORE-152) Lack of NHttpRequestHandler breaks AsyncNHttpServiceHandler
Date Sat, 01 Mar 2008 13:24:51 GMT

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

Oleg Kalnichevski resolved HTTPCORE-152.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0-beta2

Patch checked in. Many thanks, Sam. I took liberty of changing the signature of the responseComplete
method from #responseComplete(NHttpServerConnection conn, HttpResponse response) to #responseComplete(HttpResponse
response, HttpContext context). I think this way it is more consistent with the rest of API
and one can always obtain the connection from the context.

Oleg

> Lack of NHttpRequestHandler breaks AsyncNHttpServiceHandler
> -----------------------------------------------------------
>
>                 Key: HTTPCORE-152
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-152
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>            Reporter: Sam Berlin
>             Fix For: 4.0-beta2
>
>         Attachments: changes.txt
>
>
> In AsyncNHttpServiceHandler.sendResponse, the connection is closed before the response
is submitted.  The patch moves the submitResponse to before 'close', so that it correctly
goes into the CLOSING state instead of CLOSED.  Also added a test to that broke before but
now passes.  
> Seperate from the fix is a new 'responseComplete' method that's called after an entity
is fully written or immediately when submitting if there's no entity.  This is very useful
for subclasses that want to hook into knowing when a response has been written.  There's no
good way to do it w/o the hook because of the asynchronous nature of the sending.  (LimeWire,
for example, uses to notify listeners when a response is sent and to add an event for triggering
a read if there was buffered read data, since the underlying NIO layer doesn't do it automatically.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message