How to read chuncked Http Data ?
Sumit Arora
sumit1234 at gmail.com
Mon Nov 29 00:32:20 EST 2010
In my Http Server Implementation,
1).First my server recv HttpRequest with Transfer-Encoding=Chunked, and
Server get the request by doing :
HttpRequest httpRequest = this.request = (HttpRequest) e.getMessage();
inside messageReceived
2).then my server respond back with 200 OK to client
3)Now Client sends Chunked Message as " Length -- Data " e.g; (11 -
handshake)
Server recv from :
if(!readingChunks)
{ HttpChunk chunk = (HttpChunk) e.getMessage();
................
}
4)Server send the requisite response back to Client;
5). Now Client sends big chunk of message e.g; ( 2MB - File)..
6) How Server can read this file ?
I have seen several discussion e.g; FrameDecoder , ChunkedInput etc ? but
didn't find straightforward way ?
Even I tried like this : public class XYZFrameDecoder extends FrameDecoder
{...
Override
protected Object decode(ChannelHandlerContext ctx,
Channel channel,
ChannelBuffer buf) throws Exception
{ ... as available ine xample..
}
}
and placed to XYZFrameDecoder Pipeline Factory ? but it didn't work, because
it used to be called for every http request. But I have to used a way to
handle this specific chunked request which is greater than 8192 ?
Looking forward to hear your comments ?
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-read-chuncked-Http-Data-tp5783345p5783345.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list