mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julien Vermillard (JIRA)" <j...@apache.org>
Subject [jira] Commented: (ASYNCWEB-11) HttpResponseDecoder not finishing decode process before some content is received
Date Thu, 24 Apr 2008 08:13:21 GMT

    [ https://issues.apache.org/jira/browse/ASYNCWEB-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591943#action_12591943
] 

Julien Vermillard commented on ASYNCWEB-11:
-------------------------------------------

I tried decoding this response, It's producing an endless loop, it's looking serious.

Thanks for the report

> HttpResponseDecoder not finishing decode process before some content is received
> --------------------------------------------------------------------------------
>
>                 Key: ASYNCWEB-11
>                 URL: https://issues.apache.org/jira/browse/ASYNCWEB-11
>             Project: Asyncweb
>          Issue Type: Bug
>          Components: Common
>         Environment: FCGIHttpService
>            Reporter: Daniel Wirtz
>            Priority: Trivial
>
> Basically I transform FastCGI responses into HTTP responses using the HttpResponseDecoder
in conjunction with AsyncFCGI (0.9.0 CVS):
> public void onReceive(FCGIRequest request, FCGIResponse response) {
>   HttpServiceContext context = (HttpServiceContext) request.getAttachment();
>   HttpResponseDecoder decoder = new HttpResponseDecoder();
>   DecoderOutput output = new DecoderOutput(context); // Custom output implementing a
write() method
>   decoder.decode(null, IoBuffer.wrap("HTTP/1.1 200 OK\r\n".getBytes()), output);
>   decoder.decode(null, response.getStdout(), output);
>   decoder.finishDecode(null, output); // HttpResonse is produced and sent to DecoderOutput
>   decoder.dispose(null);
> }
> This works fine so far, but when an empty response (in this case produced by PHP is received),
no write() to DecoderOutput occurs even though the finishDecode() method was called. The response
looks like this:
> Content-Type: text/html\r\n
> \r\n
> As a result of this, I'm not able to use the decoder in this particular case to produce
HttpResponse objects for further asyncweb processing originating from a FastCGI backend. The
connection just times out because no response is produced. However, if Content-Length: 0 is
provided, it works fine (but PHP does not produce this header by default, it is added by the
webserver, in this case this would be asyncweb).
> The reason that I don't want to preparse the output by myself is that this results in
unneccessary double checking (converting the IoBuffer to something parseable and checking
headers twice).

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


Mime
View raw message