You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/09/09 10:42:58 UTC

[15/19] mochiweb commit: updated refs/heads/upstream to bd6ae7c

Don't swallow 'other' messages

Mochiweb handlers that use the message queue can sometimes find that
mochiweb has swallowed messages, causing them to timeout or block for
a reply that will never come.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/commit/61a65fea
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/tree/61a65fea
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/diff/61a65fea

Branch: refs/heads/upstream
Commit: 61a65fea7d6b1e9f93c4a2c6b96e96dee02bec6e
Parents: 952087e
Author: Robert Newson <rn...@apache.org>
Authored: Tue Sep 8 10:39:48 2015 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Sep 8 10:42:27 2015 +0100

----------------------------------------------------------------------
 src/mochiweb_http.erl | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/blob/61a65fea/src/mochiweb_http.erl
----------------------------------------------------------------------
diff --git a/src/mochiweb_http.erl b/src/mochiweb_http.erl
index a9290a2..568019f 100644
--- a/src/mochiweb_http.erl
+++ b/src/mochiweb_http.erl
@@ -99,9 +99,7 @@ request(Socket, Opts, Body) ->
             exit(normal);
         {ssl_closed, _} ->
             mochiweb_socket:close(Socket),
-            exit(normal);
-        Other ->
-            handle_invalid_msg_request(Other, Socket, Opts)
+            exit(normal)
     after ?REQUEST_RECV_TIMEOUT ->
         mochiweb_socket:close(Socket),
         exit(normal)
@@ -129,7 +127,7 @@ headers(Socket, Opts, Request, Headers, Body, HeaderCount) ->
         {tcp_closed, _} ->
             mochiweb_socket:close(Socket),
             exit(normal);
-        Other ->
+        {tcp_error, _, emsgsize} = Other ->
             handle_invalid_msg_request(Other, Socket, Opts, Request, Headers)
     after ?HEADERS_RECV_TIMEOUT ->
         mochiweb_socket:close(Socket),
@@ -143,10 +141,6 @@ call_body({M, F}, Req) ->
 call_body(Body, Req) ->
     Body(Req).
 
--spec handle_invalid_msg_request(term(), term(), term()) -> no_return().
-handle_invalid_msg_request(Msg, Socket, Opts) ->
-    handle_invalid_msg_request(Msg, Socket, Opts, {'GET', {abs_path, "/"}, {0,9}}, []).
-
 -spec handle_invalid_msg_request(term(), term(), term(), term(), term()) -> no_return().
 handle_invalid_msg_request(Msg, Socket, Opts, Request, RevHeaders) ->
     case {Msg, r15b_workaround()} of