From commits-return-32187-archive-asf-public=cust-asf.ponee.io@couchdb.apache.org Sun Feb 18 18:29:57 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 40C021807E4 for ; Sun, 18 Feb 2018 18:29:53 +0100 (CET) Received: (qmail 76865 invoked by uid 500); 18 Feb 2018 17:29:50 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 76536 invoked by uid 99); 18 Feb 2018 17:29:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Feb 2018 17:29:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 80CE1F3347; Sun, 18 Feb 2018 17:29:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wohali@apache.org To: commits@couchdb.apache.org Date: Sun, 18 Feb 2018 17:29:58 -0000 Message-Id: <3dc9e763b41b4494ac19751c7e1b0922@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [13/50] mochiweb commit: updated refs/heads/master to 999f464 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/master Commit: 61a65fea7d6b1e9f93c4a2c6b96e96dee02bec6e Parents: 952087e Author: Robert Newson Authored: Tue Sep 8 10:39:48 2015 +0100 Committer: Robert Newson 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