From 0ea1b80f95f0d98a3d1bf4c0223d0689c17385c2 Mon Sep 17 00:00:00 2001 From: Konrad Pietrzak Date: Fri, 6 Sep 2024 15:53:55 +0200 Subject: [PATCH] formatting fixes --- lib/inets/src/http_client/httpc.erl | 2 +- lib/inets/src/http_client/httpc_handler.erl | 6 +-- lib/inets/src/http_client/httpc_request.erl | 48 ++++++++++---------- lib/inets/src/http_client/httpc_response.erl | 3 +- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index 2087c7bf4227..a599915f911d 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -803,7 +803,7 @@ handle_request(Method, Url, started = Started, unix_socket = UnixSocket, ipv6_host_with_brackets = BracketedHost, - request_options = Options}, + request_options = Options}, case httpc_manager:request(Request, profile_name(Profile)) of {ok, RequestId} -> handle_answer(RequestId, Receiver, Sync, Options, diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index 3d62cb7ee84d..4518e96d50bb 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1761,14 +1761,14 @@ do_format_answer({Ref, {StatusLine, Headers, BinBody}}, true, Sync) -> {Ref, {ok, {StatusLine, Headers, BinBody}}}; _ -> {Ref, {StatusLine, Headers, BinBody}} - end; + end; do_format_answer({Ref, {StatusLine, _, BinBody}}, false, Sync) -> - {_, Status, _} = StatusLine, + {_, Status, _} = StatusLine, case Sync of true -> {Ref, {ok, {Status, BinBody}}}; _ -> {Ref, Status, BinBody} - end; + end; do_format_answer({Ref, {error, _Reason} = Error}, _, _) -> {Ref, Error}. diff --git a/lib/inets/src/http_client/httpc_request.erl b/lib/inets/src/http_client/httpc_request.erl index 2ec6cf24de34..a9fcdc944959 100644 --- a/lib/inets/src/http_client/httpc_request.erl +++ b/lib/inets/src/http_client/httpc_request.erl @@ -55,32 +55,32 @@ send(SendAddr, #session{socket = Socket, socket_type = SocketType}, Request) -> send(SendAddr, Socket, SocketType, Request). send(SendAddr, Socket, SocketType, - #request{method = Method, - path = Path, - pquery = Query, - headers = Headers, - content = Content, - address = Address, - abs_uri = AbsUri, - headers_as_is = HeadersAsIs, - settings = HttpOptions, - userinfo = UserInfo, - request_options = Options}) -> + #request{method = Method, + path = Path, + pquery = Query, + headers = Headers, + content = Content, + address = Address, + abs_uri = AbsUri, + headers_as_is = HeadersAsIs, + settings = HttpOptions, + userinfo = UserInfo, + request_options = Options}) -> ?hcrt("send", - [{send_addr, SendAddr}, - {socket, Socket}, - {method, Method}, - {path, Path}, - {pquery, Query}, - {headers, Headers}, - {content, Content}, - {address, Address}, - {abs_uri, AbsUri}, - {headers_as_is, HeadersAsIs}, - {settings, HttpOptions}, - {userinfo, UserInfo}, - {request_options, Options}]), + [{send_addr, SendAddr}, + {socket, Socket}, + {method, Method}, + {path, Path}, + {pquery, Query}, + {headers, Headers}, + {content, Content}, + {address, Address}, + {abs_uri, AbsUri}, + {headers_as_is, HeadersAsIs}, + {settings, HttpOptions}, + {userinfo, UserInfo}, + {request_options, Options}]), TmpHdrs = handle_user_info(UserInfo, Headers), diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl index 6872589fcce4..a3b81a6f7c2e 100644 --- a/lib/inets/src/http_client/httpc_response.erl +++ b/lib/inets/src/http_client/httpc_response.erl @@ -150,8 +150,7 @@ result(Response = {{_,Code,_}, _, _}, Request) when (Code div 100) =:= 5 -> result(Response, Request) -> transparent(Response, Request). -send(Receiver, Msg) when is_pid(Receiver) - orelse is_reference(Receiver) -> +send(Receiver, Msg) when is_pid(Receiver); is_reference(Receiver) -> Receiver ! {http, Msg}; send(Receiver, Msg) when is_function(Receiver) -> (catch Receiver(Msg));