diff options
author | ILYA Khlopotov <iilyak@apache.org> | 2019-09-25 11:03:45 +0000 |
---|---|---|
committer | ILYA Khlopotov <iilyak@apache.org> | 2019-10-01 13:21:13 +0000 |
commit | 1186b3906b9c4611a2d1310bba7b70db20420585 (patch) | |
tree | 6ff5d6c09cc263ffa4b4afe62d6d3b7a6362d230 | |
parent | fe9ffad8fa49bcbe071f416805564547e80c6b96 (diff) | |
download | couchdb-1186b3906b9c4611a2d1310bba7b70db20420585.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 4d32c03c5..e4ddb6a59 100644 --- a/src/chttpd/src/chttpd.erl +++ b/src/chttpd/src/chttpd.erl @@ -1036,9 +1036,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), |