[erlang-questions] Any tcp related changes in R15B* that might cause this?

Anthony Molinaro anthonym@REDACTED
Wed Jan 2 18:28:16 CET 2013


  The holidays went and interrupted everything, so I'm sorry about the
late response.
It's unclear if the commit dc5f7190 did it or not, but sometime between
R14B04 and R15B02 the behavior did change.  I've not isolated it outside
of mochiweb, but I don't think its a mochiweb problem.

Here's the pull request which contains the short program I used to
reproduce with mochiweb (and work around the new behavior)


I'll see if I can't isolate it to just OTP sometime in the next
couple of days.


On Mon, Dec 17, 2012 at 04:10:55PM +0100, Sverker Eriksson wrote:
> Have I understood it correctly so far if I say that my commit
> dc5f7190 seems to cause a
> {tcp_error,Port,emsgsize}
> while earlier versions caused a
> {http,Port,{http_error,"..."}}
> for the same scenario with some sort of very long http lines?
> /Sverker, Erlang/OTP
> Anthony Molinaro wrote:
> >On Fri, Dec 14, 2012 at 11:32:11AM -0500, Steve Vinoski wrote:
> >>Hi Anthony, based on your example, it looks like a follow-up commit that
> >>modified some of the changes introduced by my patch introduced the issue
> >>you're seeing: commit dc5f7190. You might want to report it over on
> >>erlang-bugs.
> >
> >Nice catch, I guess that it's actually not enough to return error
> >for backward compatibility ;)
> >
> >I think the main thing I'm still not sure of is if the decode_packet changes
> >are actually the cause.  I was able to call decode_packet with long headers
> >and not actually see an issue.
> >
> >This
> >
> >erlang:decode_packet ( httph,
> >                       list_to_binary ([ "X-Random: ",
> >                                         [$a || _ <- lists:seq(1,10000)],
> >                                         "\r\n\r\n"
> >                                       ]),
> >                       []).
> >
> >Returns the same thing in both R14B04 and R15B02.  And as far as I am able
> >to tell that is the only call made to decode_packet in mochiweb.
> >
> >I think the actual error is around recvbuf sizing (mochiweb uses 8192 as
> >the default, so 10000 is definitely larger than that, however, the standard
> >libraries must be doing something different as now it returns emsgsize
> >where it did no in the past).  I really wish there was a way to search
> >commits on github as then I could search for recvbuf or something like
> >that to see what might have changed.
> >
> >Before I go over to bugs I'll probably try to detangle mochiweb enough
> >to create a small reproducible test case.
> >
> >I also have a pull request into mochiweb which prevents the crash but
> >has the annoying behavior at the moment that it returns an error to the
> >client about disconnecting version the 400 error it returned before.
> >
> >https://github.com/mochi/mochiweb/pull/91
> >
> >But since the standard library seems to be the one closing the socket
> >there's not much that can be done other than the fix I put in place.
> >
> >Thanks for your help Steve,
> >
> >-Anthony
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Anthony Molinaro                           <anthonym@REDACTED>

More information about the erlang-questions mailing list