]> granicus.if.org Git - libevent/commitdiff
don't require string literal for message name
authorNiels Provos <provos@gmail.com>
Mon, 20 Nov 2006 07:57:36 +0000 (07:57 +0000)
committerNiels Provos <provos@gmail.com>
Mon, 20 Nov 2006 07:57:36 +0000 (07:57 +0000)
svn:r270

evrpc.h
test/regress_rpc.c

diff --git a/evrpc.h b/evrpc.h
index 5c9d2a81f094f473dfcf78524ed20109b7914bc1..4640d0ba562ce015c1be6d19718f954c7311c1dc 100644 (file)
--- a/evrpc.h
+++ b/evrpc.h
@@ -49,7 +49,7 @@
  *
  * A specific RPC can then be registered with
  *
- * EVRPC_REGISTER(base, "SendCommand", Request, Reply,  FunctionCB, arg);
+ * EVRPC_REGISTER(base, SendCommand, Request, Reply,  FunctionCB, arg);
  *
  * when the server receives an appropriately formatted RPC, the user callback
  * is invokved.   The callback needs to fill in the reply structure.
@@ -185,7 +185,7 @@ int evrpc_send_request_##rpcname(struct evrpc_pool *pool, \
 /* Takes a request object and fills it in with the right magic */
 #define EVRPC_REGISTER_OBJECT(rpc, name, request, reply) \
   do { \
-    (rpc)->uri = strdup(name); \
+    (rpc)->uri = strdup(#name); \
     if ((rpc)->uri == NULL) \
       event_err(1, "failed to register object"); \
     (rpc)->request_new = (void *(*)(void))request##_new; \
index ceae96415c4a590f79ccc0b96415f2c9af20d4a1..863b9571d0d636d35be7dfcae4181d7074235438 100644 (file)
@@ -111,7 +111,7 @@ rpc_setup(struct evhttp **phttp, short *pport, struct evrpc_base **pbase)
        http = http_setup(&port);
        base = evrpc_init(http);
        
-       EVRPC_REGISTER(base, "Message", msg, kill, MessageCB, NULL);
+       EVRPC_REGISTER(base, Message, msg, kill, MessageCB, NULL);
 
        *phttp = http;
        *pport = port;