Revision
16525
Author
anthm
Date
2010-01-27 15:08:11 -0600 (Wed, 27 Jan 2010)

Log Message

exec sql stmt sooner to prevent race

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (16524 => 16525)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	2010-01-27 15:36:24 UTC (rev 16524)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	2010-01-27 21:08:11 UTC (rev 16525)
@@ -2320,14 +2320,14 @@
 									" and profile_name='%q' and hostname='%q'",
 									from_user, from_host, profile->name, mod_sofia_globals.hostname
 									))) {
-					sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
+					sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
 				}
 					 
 				if ((sql =
 					 switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent, profile_name, hostname) "
 									"values ('%q','%q','%q','%q',%ld,'%q','%q','%q')",
 									from_user, from_host, note_txt, rpid, exp, full_agent, profile->name, mod_sofia_globals.hostname))) {
-					sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
+					sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
 				}
 				
 				event_type = sip_header_as_string(profile->home, (void *) sip->sip_event);