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

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

After some debugging, look like the problem in in the state machine codec 
(ConsumeToEndOfSessionDecodingState), I'm going to open a MINA specific issue 
for that

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

Reply via email to