diff options
author | ILYA Khlopotov <iilyak@apache.org> | 2019-09-25 11:03:45 +0000 |
---|---|---|
committer | ILYA Khlopotov <iilyak@apache.org> | 2019-10-24 17:25:43 +0000 |
commit | fc6cc980cf3cdd9163ae64ddd7215b6d60dd8bd9 (patch) | |
tree | 3c7d11c68b7d5e5fede89f8c3c79acce679b404a | |
parent | be2364d9c5993259e353bc13bfa89c754246eea9 (diff) | |
download | couchdb-fc6cc980cf3cdd9163ae64ddd7215b6d60dd8bd9.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.erl | 3 | ||||
-rw-r--r-- | src/couch/src/couch_httpd.erl | 3 |
2 files changed, 0 insertions, 6 deletions
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl index 1e1d638be..87fb34158 100644 --- a/src/chttpd/src/chttpd.erl +++ b/src/chttpd/src/chttpd.erl @@ -1029,9 +1029,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), |