[erlang-questions] gen_tcp and large HTTP headers

Robert Virding <>
Thu Jun 23 22:10:22 CEST 2011


Wouldn't it be better to rewrite the packet parser to work in a re-entrant fashion so as to be able to span over many packets? It would save a lot of fiddling with the recbuf size.

Robert

----- "Sverker Eriksson" <> wrote:

> The bug is causing http lines to get truncated when the inet_drv 
> in-buffer gets full.
> 
> It would be nicer to dynamically expand the in-buffer and let 
> inet:setopts option {packet_size, MaxSize} be used to protect against
> 
> DoS attacks as it can for other packet types.**
> 
> Steve Vinoski wrote:
> 
> > Looking at the packet parser, I'm thinking it always treats this
> case
> > as HTTP version 0.9, so that's wrong as well.
> >
> 
> What's wrong? I didn't understand that.
> 
> /Sverker, Erlang/OTP
> 
> 
> Paolo Negri wrote:
> > Hi Everyone,
> >
> > Thanks for discussing this, we encountered the problem on our
> system
> > and filed the bug that originated Roberto's email [1].
> > We're currently working around the problem by setting recbuf on the
> > socket, this temporary solution is not too bad in real life if the
> > need is only to cope with requests originated by browsers as
> currently
> > fairly popular ones can't handle over 2048 characters [2].
> > While this is suitable as a temporary solution it really feels like
> > the current implementation of inet is incorrect as it states "The
> > packets are returned with the format according to HttpPacket
> described
> > in erlang:decode_packet/3" [3] and instead the results are
> different
> > from those one would get by calling erlang:decode_packet/3
> >
> > [1] https://github.com/ostinelli/misultin/issues/40
> > [2] http://support.microsoft.com/kb/208427
> > [3] http://www.erlang.org/doc/man/inet.html#setopts-2
> >
> > Thanks,
> >
> > Paolo
> >
> > On Thu, Jun 23, 2011 at 7:59 AM, ERLANG <> wrote:
> >   
> >> Hi Steve, Roberto,
> >>
> >> Maybe the Erlang team should consider and fix that problem
> >> on next releases!
> >>
> >> /Zab
> >>     
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
> >
> >   
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list