diff options
author | Alexey Shchepin <alexey@process-one.net> | 2004-09-29 21:10:40 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2004-09-29 21:10:40 +0000 |
commit | db824bfc6484f4429e830364d0a897a7f7f65f4d (patch) | |
tree | a698b1300653903feeac44bb37f065874bba4bff | |
parent | * src/web/ejabberd_http.erl: Bugfix (diff) |
* src/ejabberd_listener.erl: Check result of controlling_process
SVN Revision: 270
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/ejabberd_listener.erl | 9 |
2 files changed, 9 insertions, 2 deletions
@@ -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> diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 2bb526cb..2ea422c3 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -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); |