couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [33/49] chttpd commit: updated refs/heads/windsor-merge to 554ef74
Date Fri, 01 Aug 2014 09:06:09 GMT
Ensure result of send_delayed_error is always a #delayed_resp

BugzID: 25402


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/516b6da4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/516b6da4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/516b6da4

Branch: refs/heads/windsor-merge
Commit: 516b6da41aff9e796f29b7ec6222da172a1d49f3
Parents: 63378df
Author: Robert Newson <robert.newson@cloudant.com>
Authored: Sat Nov 16 17:31:04 2013 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Jul 31 11:53:43 2014 +0100

----------------------------------------------------------------------
 src/chttpd.erl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/516b6da4/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 0c9d0e0..93b56f0 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -637,9 +637,10 @@ send_delayed_chunk(#delayed_resp{}=DelayedResp, Chunk) ->
 send_delayed_last_chunk(Req) ->
     send_delayed_chunk(Req, []).
 
-send_delayed_error(#delayed_resp{req=Req,resp=nil}, Reason) ->
+send_delayed_error(#delayed_resp{req=Req,resp=nil}=DelayedResp, Reason) ->
     {Code, ErrorStr, ReasonStr} = error_info(Reason),
-    send_error(Req, Code, ErrorStr, ReasonStr);
+    {ok, Resp} = send_error(Req, Code, ErrorStr, ReasonStr),
+    {ok, DelayedResp#delayed_resp{resp=Resp}};
 send_delayed_error(#delayed_resp{resp=Resp}, Reason) ->
     log_stack_trace(json_stack(Reason)),
     throw({http_abort, Resp, Reason}).


Mime
View raw message