[erlang-questions] tcp active mode connection with http packet sometimes gives tcp packets?

Marc Sugiyama marcsugiyama@REDACTED
Sat Oct 18 04:03:29 CEST 2008

> We are using a locally modified mochiweb that uses active mode
> (active, true).  Mochiweb uses the http packet mode.

I'm going to answer my own question.

I think I've tracked down the problem.  What's happening is that after
reading the header
mochiweb puts the socket in raw mode (for the web application to read
data).  While the
socket is in raw mode, we're getting another http request, which ends
up being fed into
mochiweb's http receive loop as tcp rather than http packets.

This likely isn't a problem with passive mode, since Erlang won't
interpret the tcp data until
we explicitly read data.


More information about the erlang-questions mailing list