You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Sam Berlin (JIRA)" <ji...@apache.org> on 2008/02/29 23:51:51 UTC

[jira] Updated: (HTTPCORE-152) Lack of NHttpRequestHandler breaks AsyncNHttpServiceHandler

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

Sam Berlin updated HTTPCORE-152:
--------------------------------

    Attachment: changes.txt

Patch w/ fixes.

> 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
>         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