dev@grizzly.java.net

Re: need async http parser

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Wed, 12 Dec 2012 08:01:50 -0800

The core http module classes are here [1]. In particular, you'll want
to review HttpCodecFilter, HttpServerFilter, and possibly HttpClientFilter.

However, this module does rely on the core framework for Buffer (Grizzly
specific Buffer implementation) management, and FilterChain.



[1]
http://java.net/projects/grizzly/sources/git/show/modules/http/src/main/java/org/glassfish/grizzly/http?rev=7cead2409f03397650391bc4f0d1d3c797cedb81

> Dean Hiller <mailto:dean_at_xsoftware.biz>
> December 12, 2012 5:17 AM
> Because we are doing some research and something pretty complex with
> tcp flow control and all we need is the parser to accomplish this. We
> looked at both netty and grizzly and would have to make major
> modifications. Most people writing parsers write a re-usable one, but
> we looked at netty's and their parser is tightly coupled with netty
> itself. We are hoping grizzly might have a few classes for parsing
> that are used that are not so tightly coupled??? Maybe you could
> point me to the classes used for parsing?
>
> thanks,
> Dean
>
>
> Ryan Lubke <mailto:ryan.lubke_at_oracle.com>
> December 11, 2012 3:49 PM
> The Grizzly HTTP framework already does this - why not use it? Can
> you go into details on what you're trying to accomplish? Also, what
> version of Grizzly are you currently using?
>
>
>
> dean_at_xsoftware.biz <mailto:dean_at_xsoftware.biz>
> December 11, 2012 3:32 PM
> Is there re-usable code in grizzly that I can use for http parsing?
> ie. It would be great to feed in bytes like so and it returns null if
> there is not yet enough bytes
>
> private byte[] previousData;
>
> byte[] data = incomingMergedWithPrevious(previousData);
> HttpResponse resp = httpResponseParser.parse(data);
> if(resp == null) {
> return; //we do not have full data to parse yet
> }
>
> //otherwise fire the response to someone else.
>
> OR maybe I could re-use the code a different way. All I know is I get
> bytes that don't always have all the http headers yet since it is
> asynch stuff. Any way to parse stuff?
>
> thanks,
> Dean