Module: sip-router
Branch: master
Commit: 1f7b7e075d35d0ca00fb943795f74af99fce06a1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1f7b7e0…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Jul 15 22:49:23 2009 +0200
core: rpc more verbose when duplicates found
When duplicate rpc names are detected, print them (WARN(..)).
---
rpc_lookup.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/rpc_lookup.c b/rpc_lookup.c
index c1e1a6d..2bc286f 100644
--- a/rpc_lookup.c
+++ b/rpc_lookup.c
@@ -27,6 +27,7 @@
#include "rpc.h"
#include "str_hash.h"
#include "ut.h"
+#include "dprint.h"
#define RPC_HASH_SIZE 32
#define RPC_SARRAY_SIZE 32 /* initial size */
@@ -186,8 +187,10 @@ int rpc_register(rpc_export_t* rpc)
{
/* check if the entry is already registered */
- if (rpc_lookup(rpc->name, strlen(rpc->name)))
+ if (rpc_lookup(rpc->name, strlen(rpc->name))){
+ WARN("duplicate rpc \"%s\"\n", rpc->name);
return 1;
+ }
if (rpc_hash_add(rpc)!=0) return -1;
return 0;
}