Content ChannelBuffer Factory for HTTP Codec?

Wade Poziombka wpoziombka at hotmail.com
Mon Dec 8 14:24:42 EST 2008


I hate to be a pain but I think need to know the purpose of the buffer.  I
am really only concerned with the content buffer for the HTTPxxxDecoder.
Meaning I don't want to get in the middle of the buffers used to decode
headers etc.  I want to be able to specify the content buffer (e.g.,
HttpRequestDecoder.content.)

Or am I missing this ability here?

Wade

-----Original Message-----
From: netty-users-bounces at lists.jboss.org
[mailto:netty-users-bounces at lists.jboss.org] On Behalf Of Trustin Lee
Sent: Monday, December 08, 2008 4:02 AM
To: Netty Users
Subject: Re: Content ChannelBuffer Factory for HTTP Codec?

On Mon, Dec 08, 2008 at 06:48:59PM +0900, Trustin Lee wrote:
> Does this improvement satisfy your requirement?
> 
>   * https://jira.jboss.org/jira/browse/NETTY-96
> 
> By setting the default buffer factory to your own implementation, you
> can decide what buffer type HttpMessageDecoder will use.
> 
> However, it's somewhat different from your original suggestion; Netty
> uses the factory from the point where it allocates a receive buffer,
> which means your native buffer implementation will be used throughput
> the framework.  If it's not what you expected, we could improve the
> design of the current ChannelBufferFactory interface.

Or you could use some sort of internal flag to tell your
ChannelBufferFactory implementation that it should create the special
buffer only when the flag is set.  The flag could be stored as a
ThreadLocal and set to true before HttpMessageDecoder.decode() and set
to false after HttpMessageDecoder.decode().
 
-- 
Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
--
what we call human nature in actuality is human habit
--
http://gleamynode.net/




More information about the netty-users mailing list