]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_listener.erl: Check result of controlling_process
authorAlexey Shchepin <alexey@process-one.net>
Wed, 29 Sep 2004 21:10:40 +0000 (21:10 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Wed, 29 Sep 2004 21:10:40 +0000 (21:10 +0000)
SVN Revision: 270

ChangeLog
src/ejabberd_listener.erl

index 29360fe33071388173944e2100c86f3920fc8d6b..829312912061db79bb9cd3e281bad4f4c3c0a4db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
index 2bb526cb3a996834dad11db3b4a6c389c1d553b8..2ea422c3030a4897eddf1142fb63c7e6a03bb79f 100644 (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);