extend/cowboy — pull request #429 by keynslug (2013-02-14 21:16:48+00:00)
Title: Make sure socket is passive once we've done with loop handler

It is sometimes important to make a socket passive as it was initially and as it is expected to be by cowboy_protocol, right after we've done with loop handling. The browser may freely pipeline a bunch of requests f previous one was, say, a JSONP long-polling request.

Specifically, when using ssl sockets, not doing so may cause strange delays on the client. Browser would pipeline request but cowboy would not be aware of it. I've stumbled upon such issue with Chrome. Instead of doing long polling request every 5 seconds, they were lasting for 10 seconds. Appears to be that another 5 seconds is exactly equal to the default keep-alive timeout.