couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [04/50] git commit: support get_modules request in socket_server, since we have a dynamic modules request (needed by release_manager)
Date Fri, 17 Jan 2014 22:52:41 GMT
support get_modules request in socket_server, since we have a dynamic modules request (needed
by release_manager)


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/commit/d450d601
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/tree/d450d601
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/diff/d450d601

Branch: refs/heads/import
Commit: d450d60181724322ffe45039bb38419a5a460875
Parents: cb82270
Author: Richard Jones <rj@metabrew.com>
Authored: Wed Sep 8 17:07:23 2010 +0800
Committer: Bob Ippolito <bob@redivi.com>
Committed: Sun Sep 19 09:07:48 2010 +0800

----------------------------------------------------------------------
 src/mochiweb_socket_server.erl | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/blob/d450d601/src/mochiweb_socket_server.erl
----------------------------------------------------------------------
diff --git a/src/mochiweb_socket_server.erl b/src/mochiweb_socket_server.erl
index 774fee7..820af1a 100644
--- a/src/mochiweb_socket_server.erl
+++ b/src/mochiweb_socket_server.erl
@@ -258,6 +258,20 @@ handle_info({'EXIT', Pid, Reason},
             ok
     end,
     {noreply, recycle_acceptor(Pid, State)};
+
+% this is what release_handler needs to get a list of modules,
+% since our supervisor modules list is set to 'dynamic'
+% see sasl-2.1.9.2/src/release_handler_1.erl get_dynamic_mods
+handle_info({From, Tag, get_modules}, State = #mochiweb_socket_server{name={local,Mod}})
->
+    From ! {element(2,Tag), [Mod]},
+    {noreply, State};
+
+% If for some reason we can't get the module name, send empty list to avoid release_handler
timeout:
+handle_info({From, Tag, get_modules}, State) ->
+    error_logger:info_msg("mochiweb_socket_server replying to dynamic modules request as
'[]'~n",[]),
+    From ! {element(2,Tag), []},
+    {noreply, State};
+
 handle_info(Info, State) ->
     error_logger:info_report([{'INFO', Info}, {'State', State}]),
     {noreply, State}.


Mime
View raw message