Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Szlosarczyk committed Jul 29, 2019
1 parent 8afbf22 commit 0231aae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 4 additions & 2 deletions apps/epp_proxy/src/epp_http_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 7 additions & 8 deletions apps/epp_proxy/src/epp_tls_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).

Expand Down
1 change: 0 additions & 1 deletion apps/epp_proxy/test/tls_client_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0231aae

Please sign in to comment.