summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILYA Khlopotov <iilyak@apache.org>2019-09-25 11:03:45 +0000
committerILYA Khlopotov <iilyak@apache.org>2019-10-24 17:15:43 +0000
commit797fe0811fa52dad211b5881a049df536ae65337 (patch)
treea37cfa325bde38e2708ccbd0924bf11b6be599d9
parentf3d572caf112598d12d705f98dffb8cdbb2bec97 (diff)
downloadcouchdb-797fe0811fa52dad211b5881a049df536ae65337.tar.gz
Remove old clause which is no longer used
The history of `send_error(_Req, {already_sent, Resp, _Error})` clause is bellow: - it was added on [2009/04/18](https://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?r1=762574&r2=765819&diff_format=h) - we triggered that clause [in couch_httpd:do](https://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?revision=642432&view=markup#l88) - at that time we were using inets webserver [see use of `httpd_response/3`](https://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?revision=642432&view=markup#l170) - The inets OTP codebase uses `already_sent` messages [here](https://github.com/erlang/otp/blob/50214f02501926fee6ec286efa68a57a47c2e531/lib/inets/src/http_server/httpd_response.erl#L220) It should be safe to remove this clause because we are not using inets anymore and search of `already_sent` term across all dependencies doesn't return any results.
-rw-r--r--src/chttpd/src/chttpd.erl3
-rw-r--r--src/couch/src/couch_httpd.erl3
2 files changed, 0 insertions, 6 deletions
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index fb227aea3..2f4bbcf4a 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -1038,9 +1038,6 @@ error_headers(#httpd{mochi_req=MochiReq}=Req, 401=Code, ErrorStr, ReasonStr) ->
error_headers(_, Code, _, _) ->
{Code, []}.
-send_error(_Req, {already_sent, Resp, _Error}) ->
- {ok, Resp};
-
send_error(#httpd{} = Req, Error) ->
update_timeout_stats(Error, Req),
diff --git a/src/couch/src/couch_httpd.erl b/src/couch/src/couch_httpd.erl
index 3cdfc0ca3..10b44d16d 100644
--- a/src/couch/src/couch_httpd.erl
+++ b/src/couch/src/couch_httpd.erl
@@ -977,9 +977,6 @@ error_headers(#httpd{mochi_req=MochiReq}=Req, Code, ErrorStr, ReasonStr) ->
{Code, []}
end.
-send_error(_Req, {already_sent, Resp, _Error}) ->
- {ok, Resp};
-
send_error(Req, Error) ->
{Code, ErrorStr, ReasonStr} = error_info(Error),
{Code1, Headers} = error_headers(Req, Code, ErrorStr, ReasonStr),