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 2014/08/28 13:59:52 UTC

[29/50] chttpd commit: updated refs/heads/master to 58020ab

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/master
Commit: 516b6da41aff9e796f29b7ec6222da172a1d49f3
Parents: 63378df
Author: Robert Newson <ro...@cloudant.com>
Authored: Sat Nov 16 17:31:04 2013 +0000
Committer: Robert Newson <rn...@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}).