mirror of
https://github.com/internetee/epp_proxy.git
synced 2025-08-16 20:43:47 +02:00
Remove some code cuplication
This commit is contained in:
parent
0e46f52630
commit
a73f7428fc
4 changed files with 10 additions and 16 deletions
|
@ -8,8 +8,13 @@
|
|||
epp_verb % Epp verb that is targeted, plus 'error'
|
||||
}).
|
||||
|
||||
-type epp_request() :: #epp_request{}.
|
||||
-record(valid_frame, {command, cl_trid, raw_frame}).
|
||||
|
||||
-record(invalid_frame, {code, cl_trid, message}).
|
||||
|
||||
-record(state, {socket, session_id, headers}).
|
||||
|
||||
-type epp_request() :: #epp_request{}.
|
||||
|
||||
-define(XMLErrorCode, <<"2001">>).
|
||||
|
||||
|
|
|
@ -84,8 +84,8 @@ request_from_map(#{command := Command,
|
|||
%% Get hackney options
|
||||
hackney_options(Cookies) ->
|
||||
case application:get_env(epp_proxy, insecure) of
|
||||
false -> [{cookies, Cookies}, insecure];
|
||||
_ -> [{cookies, Cookies}]
|
||||
false -> [{cookie, Cookies}, insecure];
|
||||
_ -> [{cookie, Cookies}]
|
||||
end.
|
||||
|
||||
%% Return form data or an empty list.
|
||||
|
|
|
@ -12,12 +12,6 @@
|
|||
|
||||
-export([code_change/3]).
|
||||
|
||||
-record(valid_frame, {command, cl_trid, raw_frame}).
|
||||
|
||||
-record(invalid_frame, {code, cl_trid, message}).
|
||||
|
||||
-record(state, {socket, session_id, headers}).
|
||||
|
||||
%% Initialize process
|
||||
%% Assign an unique session id that will be passed on to http server as a cookie
|
||||
init(Socket) ->
|
||||
|
|
|
@ -12,12 +12,6 @@
|
|||
|
||||
-export([code_change/3]).
|
||||
|
||||
-record(valid_frame, {command, cl_trid, raw_frame}).
|
||||
|
||||
-record(invalid_frame, {code, cl_trid, message}).
|
||||
|
||||
-record(state, {socket, session_id, headers}).
|
||||
|
||||
%% Initialize process
|
||||
%% Assign an unique session id that will be passed on to http server as a cookie
|
||||
init(Socket) ->
|
||||
|
@ -171,7 +165,8 @@ log_on_invalid_handshake(Ip, Error) ->
|
|||
|
||||
log_opened_connection(Ip) ->
|
||||
ReadableIp = epp_util:readable_ip(Ip),
|
||||
lager:info("New client connection. IP: ~s, Process: ~p.~n",
|
||||
lager:info("New client connection. IP: ~s, Process: "
|
||||
"~p.~n",
|
||||
[ReadableIp, self()]).
|
||||
|
||||
%% Extract state info from socket. Fail if you must.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue