Commits

Anonymous committed 6cc9439

Added explicit timeout handling to gen_tcp:recv calls mochiweb_http.

Firefox was getting intermittent 400 errors after a period of inactivity
on persistent connections. If the connection timed out just before
the request arrived a 400 was being sent by handle_invalid_request
and interpreted as the response by firefox.
Now it just closes the connection if no request is pending.

  • Participants
  • Parent commits 5ccf25b

Comments (0)

Files changed (1)

File src/mochiweb_http.erl

         {error, closed} ->
             gen_tcp:close(Socket),
             exit(normal);
+        {error, timeout} ->
+            gen_tcp:close(Socket),
+            exit(normal);            
         _Other ->
             handle_invalid_request(Socket)
     end.