I solved the problem (in my code, anyway) by putting another filter in front
of the HttpRequestDecoder -- the simple filter just accumulates data until
it finds the double CrLf, and only then sends it on to HttpRequestDecoder .

Obviously not a permanent solution, but it does the job for now.

I would like to understand enough about the HttpRequestDecoder to fix it,
but the code is so heavily factored that it is hard for me to follow how it
works.


On Tue, Dec 21, 2010 at 2:19 PM,  <[email protected]> wrote:
> I am seeing a problem with asyncweb in a particular case when the
> incoming header is spread over two io buffers.  I believe that in most
> cases, the decode picks up with the next buffer and keeps going
> through the entire request, or a problem would have been seen before
> now.  In fact, in my own testing with various browsers, I see no
> problems at all, with the one exception below when I click Refresh on
> Firefox.  In that case, this problem happens fairly reliably.
>
> My setup is as follows:
>
> Mina 2.01
> Async Web trunk: December 9, 2010
> JRE 1.6.0_22 64 bit
> Win7 x64
>
> initialization:
>
> NioSocketAcceptor acceptor80 = new NioSocketAcceptor();
> acceptor80.getFilterChain().addLast("codec",new
> ProtocolCodecFilter(new HttpCodecFactory()));
> acceptor80.setHandler(new MyHttpHandler());
> acceptor80.bind(new InetSocketAddress(80));
>
> The incoming IoBuffers are as follows: (note second buffer has trailing
CrLf)
>
> ===================================
> GET /-1/iv6/gwt/chrome/images/hborder.png HTTP/1.1
> Host: local.zzzzzzzzz.net
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
> rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
> Accept: image/png,image/*;q=0.8,*/*;q=0.5
> Accept-Language: en-us,en;q=0.5
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive: 115
> Connection: keep-alive
> Referer: http://local.zzzzzzzzz.net/-1/iv6/gwt/chrome/chrome.css
> If-Modified-Since: Fri, 17 Dec 2010 00:01:48 GMT
> Cache-Control: ma
> ===================================
> x-age=0
>
> ===================================
>
> I am seeing a new request decoding state beginning at the second
> buffer, but the request is never completed and sent on to the handler,
> and the browser keeps waiting for a response that never comes.
>
> I added some debug output to HttpHeaderDecodingState and
> HttpRequestDecodingState to see what was happening.  The header fields
> are read up to and including "Cache-Control:" but the final header
> value is not completed.  See deteils below.
>
> If you can provide any guidance for how to resolve this issue, I would
> be very grateful.
>
>
> INIT REQUEST DECODING STATE
> READING HEADER NAME
> READ HEADER NAME:Host
> READING HEADER VALUE
> HEADER VALUE:local.zzzzzzzzz.net
> READING HEADER NAME
> READ HEADER NAME:User-Agent
> READING HEADER VALUE
> HEADER VALUE:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
> rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
> READING HEADER NAME
> READ HEADER NAME:Accept
> READING HEADER VALUE
> HEADER VALUE:image/png,image/*;q=0.8,*/*;q=0.5
> READING HEADER NAME
> READ HEADER NAME:Accept-Language
> READING HEADER VALUE
> HEADER VALUE:en-us,en;q=0.5
> READING HEADER NAME
> READ HEADER NAME:Accept-Encoding
> READING HEADER VALUE
> HEADER VALUE:gzip,deflate
> READING HEADER NAME
> READ HEADER NAME:Accept-Charset
> READING HEADER VALUE
> HEADER VALUE:ISO-8859-1,utf-8;q=0.7,*;q=0.7
> READING HEADER NAME
> READ HEADER NAME:Keep-Alive
> READING HEADER VALUE
> HEADER VALUE:115
> READING HEADER NAME
> READ HEADER NAME:Connection
> READING HEADER VALUE
> HEADER VALUE:keep-alive
> READING HEADER NAME
> READ HEADER NAME:Referer
> READING HEADER VALUE
> HEADER VALUE:http://local.zzzzzzzzz.net/-1/iv6/gwt/chrome/chrome.css
> READING HEADER NAME
> READ HEADER NAME:If-Modified-Since
> READING HEADER VALUE
> HEADER VALUE:Fri, 17 Dec 2010 00:01:48 GMT
> READING HEADER NAME
> READ HEADER NAME:Cache-Control
> INIT REQUEST DECODING STATE
>

Reply via email to