Skip to content

Commit a73f742

Browse files
author
Maciej Szlosarczyk
committed
Remove some code cuplication
1 parent 0e46f52 commit a73f742

4 files changed

Lines changed: 10 additions & 16 deletions

File tree

apps/epp_proxy/include/epp_proxy.hrl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
epp_verb % Epp verb that is targeted, plus 'error'
99
}).
1010

11-
-type epp_request() :: #epp_request{}.
11+
-record(valid_frame, {command, cl_trid, raw_frame}).
12+
13+
-record(invalid_frame, {code, cl_trid, message}).
1214

15+
-record(state, {socket, session_id, headers}).
16+
17+
-type epp_request() :: #epp_request{}.
1318

1419
-define(XMLErrorCode, <<"2001">>).
1520

apps/epp_proxy/src/epp_http_client.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ request_from_map(#{command := Command,
8484
%% Get hackney options
8585
hackney_options(Cookies) ->
8686
case application:get_env(epp_proxy, insecure) of
87-
false -> [{cookies, Cookies}, insecure];
88-
_ -> [{cookies, Cookies}]
87+
false -> [{cookie, Cookies}, insecure];
88+
_ -> [{cookie, Cookies}]
8989
end.
9090

9191
%% Return form data or an empty list.

apps/epp_proxy/src/epp_tcp_worker.erl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212

1313
-export([code_change/3]).
1414

15-
-record(valid_frame, {command, cl_trid, raw_frame}).
16-
17-
-record(invalid_frame, {code, cl_trid, message}).
18-
19-
-record(state, {socket, session_id, headers}).
20-
2115
%% Initialize process
2216
%% Assign an unique session id that will be passed on to http server as a cookie
2317
init(Socket) ->

apps/epp_proxy/src/epp_tls_worker.erl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212

1313
-export([code_change/3]).
1414

15-
-record(valid_frame, {command, cl_trid, raw_frame}).
16-
17-
-record(invalid_frame, {code, cl_trid, message}).
18-
19-
-record(state, {socket, session_id, headers}).
20-
2115
%% Initialize process
2216
%% Assign an unique session id that will be passed on to http server as a cookie
2317
init(Socket) ->
@@ -171,7 +165,8 @@ log_on_invalid_handshake(Ip, Error) ->
171165

172166
log_opened_connection(Ip) ->
173167
ReadableIp = epp_util:readable_ip(Ip),
174-
lager:info("New client connection. IP: ~s, Process: ~p.~n",
168+
lager:info("New client connection. IP: ~s, Process: "
169+
"~p.~n",
175170
[ReadableIp, self()]).
176171

177172
%% Extract state info from socket. Fail if you must.

0 commit comments

Comments
 (0)