]> granicus.if.org Git - ejabberd/commitdiff
make http-bind restartable (thanks to Andreas Köhler)(EJAB-1318)
authorChristophe Romain <christophe.romain@process-one.net>
Wed, 13 Oct 2010 08:54:12 +0000 (10:54 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Wed, 13 Oct 2010 08:54:12 +0000 (10:54 +0200)
src/web/mod_http_bind.erl

index 25e964f93051baf102f4bdf2d177b5656abd3df6..8e750acfd101c599e85fe4736a331173e88f86a5 100644 (file)
@@ -117,7 +117,7 @@ start(_Host, _Opts) ->
             % mod_http_bind is already started so it will not be started again
             ok;
         {error, Error} ->
-            {'EXIT', {start_child_error, Error}}
+            exit({start_child_error, Error})
     end.
 
 stop(_Host) ->
@@ -125,7 +125,13 @@ stop(_Host) ->
         ok ->
             ok;
         {error, Error} ->
-            {'EXIT', {terminate_child_error, Error}}
+            exit({terminate_child_error, Error})
+    end,
+    case supervisor:delete_child(ejabberd_sup, ejabberd_http_bind_sup) of
+        ok ->
+            ok;
+        {error, Error2} ->
+            exit({delete_child_error, Error2})
     end.
 
 setup_database() ->