You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/09/02 20:34:34 UTC

[2/4] chttpd commit: updated refs/heads/master to 841ee1a

Use ?SERVICE_ID macro

COUCHDB-2796


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

Branch: refs/heads/master
Commit: f46e9c8d6893b8ad7e7a5e59c9365569ff2119b1
Parents: 3645561
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Wed Sep 2 09:50:08 2015 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Wed Sep 2 09:50:08 2015 -0700

----------------------------------------------------------------------
 src/chttpd_handlers.erl | 8 +++++---
 src/chttpd_plugin.erl   | 6 ++++--
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/f46e9c8d/src/chttpd_handlers.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_handlers.erl b/src/chttpd_handlers.erl
index 15d63d4..d4a5e27 100644
--- a/src/chttpd_handlers.erl
+++ b/src/chttpd_handlers.erl
@@ -19,6 +19,8 @@
     design_handler/2
 ]).
 
+-define(SERVICE_ID, chttpd_handlers).
+
 -include_lib("couch/include/couch_db.hrl").
 
 %% ------------------------------------------------------------------
@@ -27,7 +29,7 @@
 
 provider(App, Module) ->
     couch_epi_functions:childspec(chttpd_handlers_subscription,
-       App, chttpd_handlers, Module).
+       App, ?SERVICE_ID, Module).
 
 url_handler(HandlerKey, DefaultFun) ->
     select(collect(url_handler, [HandlerKey]), DefaultFun).
@@ -47,8 +49,8 @@ collect(Func, Args) ->
     [HandlerFun || HandlerFun <- Results, HandlerFun /= no_match].
 
 do_apply(Func, Args, Opts) ->
-    Handle = couch_epi:get_handle(?MODULE),
-    couch_epi:apply(Handle, chttpd, Func, Args, Opts).
+    Handle = couch_epi:get_handle(?SERVICE_ID),
+    couch_epi:apply(Handle, ?SERVICE_ID, Func, Args, Opts).
 
 select([], Default) ->
     Default;

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/f46e9c8d/src/chttpd_plugin.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_plugin.erl b/src/chttpd_plugin.erl
index 30e1d32..c17ffc8 100644
--- a/src/chttpd_plugin.erl
+++ b/src/chttpd_plugin.erl
@@ -18,6 +18,8 @@
     handle_error/1
 ]).
 
+-define(SERVICE_ID, chttpd).
+
 -include_lib("couch/include/couch_db.hrl").
 
 %% ------------------------------------------------------------------
@@ -44,5 +46,5 @@ with_pipe(Func, Args) ->
     do_apply(Func, Args, [pipe]).
 
 do_apply(Func, Args, Opts) ->
-    Handle = couch_epi:get_handle(chttpd),
-    couch_epi:apply(Handle, chttpd, Func, Args, Opts).
+    Handle = couch_epi:get_handle(?SERVICE_ID),
+    couch_epi:apply(Handle, ?SERVICE_ID, Func, Args, Opts).