Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Question about HttpParser in Jetty 9

Hi,

On Mon, Jun 2, 2014 at 10:26 PM, Xiaoxi Luo <Xiaoxi_Luo@xxxxxxxxxxxx> wrote:
> Hello,
>
>
>
> I am a new to Jetty and please forgive me if this is a naive question.
>
>
>
> When using HttpParser in Jetty 8, there was a method to check is there’s any
> unparsed content left in the HttpParser, namely HttpParser.isMoreInBuffer().
> I used to do something like this:
>
>
>
> while(parser.isMoreInBuffer()) {
>
> parser.parse();
>
> …
>
> }
>
>
>
> With Jetty 9, the isMoreInBuffer() method is not provided for HttpParser.
> How could I check if there’s anything left in the buffer to be parsed?

Jetty 9's architecture changed drastically with regard to parsing.
In Jetty 8 the parser was responsible for reading from the socket and
had a reference to the read buffer.
In Jetty 9 the parser is now only responsible for parsing a buffer
that is passed to the parser from outside, typically from a
Connection.

To answer your question trivially, in Jetty 9 you should look at the
buffer and see if it's fully consumed.
If not you can parse more.

But for a better answer we would need to know how exactly you are
using HttpParser.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top