25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

* src/ejabberd_listener.erl: Check result of controlling_process

SVN Revision: 270
This commit is contained in:
Alexey Shchepin 2004-09-29 21:10:40 +00:00
parent 0e2af703bd
commit db824bfc64
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2004-09-29 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_listener.erl: Check result of controlling_process
* src/web/ejabberd_http.erl: Bugfix
2004-09-27 Alexey Shchepin <alexey@sevcom.net>

View File

@ -92,7 +92,12 @@ accept(ListenSocket, Module, Opts) ->
ok
end,
{ok, Pid} = Module:start({gen_tcp, Socket}, Opts),
gen_tcp:controlling_process(Socket, Pid),
case gen_tcp:controlling_process(Socket, Pid) of
ok ->
ok;
{error, _Reason} ->
gen_tcp:close(Socket)
end,
accept(ListenSocket, Module, Opts);
{error, Reason} ->
?INFO_MSG("(~w) Failed TCP accept: ~w",
@ -139,7 +144,7 @@ accept_ssl(ListenSocket, Module, Opts) ->
ok
end,
{ok, Pid} = Module:start({ssl, Socket}, Opts),
ssl:controlling_process(Socket, Pid),
catch ssl:controlling_process(Socket, Pid),
accept_ssl(ListenSocket, Module, Opts);
{error, timeout} ->
accept_ssl(ListenSocket, Module, Opts);