From 0231aae27038a315f3bdf436b52bb6f5fd8aed28 Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Mon, 29 Jul 2019 11:25:16 +0300 Subject: [PATCH] Reformat code --- apps/epp_proxy/src/epp_http_client.erl | 6 ++++-- apps/epp_proxy/src/epp_tls_worker.erl | 15 +++++++-------- apps/epp_proxy/test/tls_client_SUITE.erl | 1 - 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/epp_proxy/src/epp_http_client.erl b/apps/epp_proxy/src/epp_http_client.erl index f9f364f..c52bc70 100644 --- a/apps/epp_proxy/src/epp_http_client.erl +++ b/apps/epp_proxy/src/epp_http_client.erl @@ -82,10 +82,12 @@ request_from_map(#{command := Command, %% Return form data or an empty list. request_body(?helloCommand, _, _) -> ""; request_body(_Command, RawFrame, nomatch) -> - {multipart, [{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}]}; + {multipart, + [{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}]}; request_body(_Command, RawFrame, ClTRID) -> {multipart, - [{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}, {<<"clTRID">>, ClTRID}]}. + [{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}, + {<<"clTRID">>, ClTRID}]}. %% Return a list of properties that each represent a query part in a query string. %% [{"user", "eis"}]} becomes later https://example.com?user=eis diff --git a/apps/epp_proxy/src/epp_tls_worker.erl b/apps/epp_proxy/src/epp_tls_worker.erl index e7d7aad..f374f66 100644 --- a/apps/epp_proxy/src/epp_tls_worker.erl +++ b/apps/epp_proxy/src/epp_tls_worker.erl @@ -44,15 +44,13 @@ start_link(Socket) -> %% mod_epp does exactly the same thing. handle_cast(serve, State = #state{socket = Socket}) -> {ok, {PeerIp, _PeerPort}} = ssl:peername(Socket), - case ssl:handshake(Socket) of - {ok, SecureSocket} -> - NewState = state_from_socket(SecureSocket, State), - {noreply, NewState}; - {error, Error} -> - log_on_invalid_handshake(PeerIp, Error) + {ok, SecureSocket} -> + NewState = state_from_socket(SecureSocket, State), + {noreply, NewState}; + {error, Error} -> + log_on_invalid_handshake(PeerIp, Error) end; - %% Step two: Using the state of the connection, get the hello route %% from http server. Send the response from HTTP server back to EPP %% client. When this succeeds, send "process_command" to self and @@ -169,7 +167,8 @@ log_on_timeout(State) -> log_on_invalid_handshake(Ip, Error) -> ReadableIp = epp_util:readable_ip(Ip), - lager:info("Failed SSL handshake. IP: ~s, Error: [~p]~n", + lager:info("Failed SSL handshake. IP: ~s, Error: " + "[~p]~n", [ReadableIp, Error]), exit(normal). diff --git a/apps/epp_proxy/test/tls_client_SUITE.erl b/apps/epp_proxy/test/tls_client_SUITE.erl index a9e8eb0..ae86826 100644 --- a/apps/epp_proxy/test/tls_client_SUITE.erl +++ b/apps/epp_proxy/test/tls_client_SUITE.erl @@ -179,7 +179,6 @@ error_test_case(Config) -> revoked_cert_test_case(Config) -> Options = proplists:get_value(revoked_options, Config), {error, Error} = ssl:connect("localhost", 1443, Options, 2000), - ct:pal("~p", [Error]), {tls_alert, {certificate_revoked, "received CLIENT ALERT: Fatal - Certificate Revoked"}} = Error,