This is an automated email from the ASF dual-hosted git repository. rnewson pushed a commit to branch revert-peer-change in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 3b601f276b1a25e285cba5d74d7685dc2c88b9f0 Author: Robert Newson <[email protected]> AuthorDate: Fri Sep 8 15:54:56 2023 +0100 Revert "print peer port in http log" This reverts commit 139ac9c05148b4c97c848bbe8d4d5abdf8e7fff5. --- src/chttpd/src/chttpd.erl | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl index 34acd494e..ab8e1e9a3 100644 --- a/src/chttpd/src/chttpd.erl +++ b/src/chttpd/src/chttpd.erl @@ -250,7 +250,7 @@ handle_request_int(MochiReq) -> P end, - Peer = peer(MochiReq), + Peer = MochiReq:get(peer), Method1 = case MochiReq:get(method) of @@ -1478,23 +1478,6 @@ get_user(#httpd{user_ctx = #user_ctx{name = User}}) -> get_user(#httpd{user_ctx = undefined}) -> "undefined". -peer(MochiReq) -> - Socket = MochiReq:get(socket), - case mochiweb_socket:peername(Socket) of - {ok, {{O1, O2, O3, O4}, Port}} -> - io_lib:format( - "~B.~B.~B.~B:~B", - [O1, O2, O3, O4, Port] - ); - {ok, {{O1, O2, O3, O4, O5, O6, O7, O8}, Port}} -> - io_lib:format( - "~B.~B.~B.~B.~B.~B.~B.~B:~B", - [O1, O2, O3, O4, O5, O6, O7, O8, Port] - ); - {error, _Reason} -> - MochiReq:get(peer) - end. - -ifdef(TEST). -include_lib("eunit/include/eunit.hrl").
