[sr-dev] Presence module in library mode

Richard Good richard.good at smilecoms.com
Thu Jan 23 10:43:27 CET 2014


Hi

I am using the presence module in library mode and have found that even
when in this mode the presence notifier process (default is number of
presence notifier processes is 1) is forked in the child init process.

I think if you are in library mode you should break out before this
process(es) is forked.

I've attached a patch - if everyone is OK I will commit this to master.

Regards
Richard.

This email is subject to the disclaimer of Smile Communications at http://www.smilecoms.com/disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20140123/13aa6f27/attachment.html>
-------------- next part --------------
diff --git a/modules/presence/presence.c b/modules/presence/presence.c
index 067a1e1..2858461 100644
--- a/modules/presence/presence.c
+++ b/modules/presence/presence.c
@@ -414,6 +414,12 @@ static int child_init(int rank)
 {
 	if (rank==PROC_INIT || rank==PROC_TCP_MAIN)
 		return 0;
+	
+	pid = my_pid();
+	
+	if(library_mode)
+		return 0;
+
 
 	if (rank == PROC_MAIN)
 	{
@@ -438,11 +444,6 @@ static int child_init(int rank)
 		return 0;
 	}
 
-	pid = my_pid();
-	
-	if(library_mode)
-		return 0;
-
 	if (pa_dbf.init==0)
 	{
 		LM_CRIT("child_init: database not bound\n");


More information about the sr-dev mailing list