Skip to content

Commit bbff7f2

Browse files
authored
Merge pull request #12 from oltarasenko/fix_ssl_connect
Fix TLS backend of Erlang distribution
2 parents 7c598e2 + 7db1c21 commit bbff7f2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/epmdless_tls_dist_proxy.erl

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222

2323
-export([listen/2, accept/2, connect/3, get_tcp_address/1]).
24-
-export([init/1, start_link/0, handle_call/3, handle_cast/2, handle_info/2,
24+
-export([init/1, start_link/0, handle_call/3, handle_cast/2, handle_info/2,
2525
terminate/2, code_change/3]).
2626

2727
-include_lib("kernel/include/net_address.hrl").
2828

2929
-include("epmdless.hrl").
3030

31-
-record(state,
31+
-record(state,
3232
{listen,
3333
accept_loop
3434
}).
@@ -146,8 +146,8 @@ handle_call({accept, _Driver, Listen}, {From, _}, State = #state{listen={_, Worl
146146
handle_call({connect, Driver, Ip, Port}, {From, _}, State) ->
147147
Me = self(),
148148
Pid = spawn_link(fun() -> setup_proxy(Driver, Ip, Port, Me) end),
149-
receive
150-
{Pid, go_ahead, LPort} ->
149+
receive
150+
{Pid, go_ahead, LPort} ->
151151
Res = {ok, Socket} = try_connect(LPort),
152152
case gen_tcp:controlling_process(Socket, From) of
153153
{error, badarg} = Error -> {reply, Error, State}; % From is dead anyway.
@@ -196,7 +196,7 @@ accept_loop(Proxy, erts = Type, Listen, Extra) ->
196196
case gen_tcp:accept(Listen) of
197197
{ok, Socket} ->
198198
Extra ! {accept,self(),Socket,inet,proxy},
199-
receive
199+
receive
200200
{_Kernel, controller, Pid} ->
201201
inet:setopts(Socket, [nodelay()]),
202202
ok = gen_tcp:controlling_process(Socket, Pid),
@@ -326,7 +326,7 @@ setup_connection(World, ErtsListen) ->
326326

327327

328328
loop_conn_setup(World, Erts) ->
329-
receive
329+
receive
330330
{ssl, World, Data = <<$a, _/binary>>} ->
331331
gen_tcp:send(Erts, Data),
332332
ssl:setopts(World, [{packet,?PPOST}, nodelay(), {active, once}]),
@@ -377,8 +377,8 @@ loop_conn(World, Erts) ->
377377

378378

379379
get_ssl_options(Type) ->
380-
application:load(epmdless_dist),
381-
{ok, Config} = application:get_env(epmdless_dist, ssl_dist_opt),
380+
application:load(epmdless),
381+
{ok, Config} = application:get_env(epmdless, ssl_dist_opt),
382382
proplists:get_value(Type, Config).
383383

384384

0 commit comments

Comments
 (0)