Permalink
Browse files

Merge pull request #91 from djnym/R15B02_mochiweb_acceptor_crash

Fix for mochiweb_acceptor crash under R15B02
  • Loading branch information...
2 parents 5ee1eeb + fedfd11 commit dcd1076f24b56bf22f10312fd667b2e84bdafbe8 @etrepum etrepum committed Dec 15, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/mochiweb_http.erl
View
@@ -66,6 +66,10 @@ request(Socket, Body) ->
{ssl_closed, _} ->
mochiweb_socket:close(Socket),
exit(normal);
+ {tcp_error,_,emsgsize} ->
+ % R15B02 returns this then closes the socket, so close and exit
+ mochiweb_socket:close(Socket),
+ exit(normal);
_Other ->
handle_invalid_request(Socket)
after ?REQUEST_RECV_TIMEOUT ->
@@ -95,6 +99,10 @@ headers(Socket, Request, Headers, Body, HeaderCount) ->
{tcp_closed, _} ->
mochiweb_socket:close(Socket),
exit(normal);
+ {tcp_error,_,emsgsize} ->
+ % R15B02 returns this then closes the socket, so close and exit
+ mochiweb_socket:close(Socket),
+ exit(normal);
_Other ->
handle_invalid_request(Socket, Request, Headers)
after ?HEADERS_RECV_TIMEOUT ->

0 comments on commit dcd1076

Please sign in to comment.