[Freeswitch-svn] [commit] r7900 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Mon Mar 17 12:12:38 EDT 2008


Author: anthm
Date: Mon Mar 17 12:12:38 2008
New Revision: 7900

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c

Log:
fix MODENDP-98

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	Mon Mar 17 12:12:38 2008
@@ -512,7 +512,7 @@
 					 char const *phrase,
 					 nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]);
 
-void sofia_glue_execute_sql(sofia_profile_t *profile, char **sqlp, switch_bool_t dyn);
+void sofia_glue_execute_sql(sofia_profile_t *profile, char **sqlp, switch_bool_t sql_already_dynamic);
 void sofia_glue_actually_execute_sql(sofia_profile_t *profile, switch_bool_t master, char *sql, switch_mutex_t *mutex);
 void sofia_reg_check_expire(sofia_profile_t *profile, time_t now);
 void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now);

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Mon Mar 17 12:12:38 2008
@@ -2487,7 +2487,7 @@
 }
 
 
-void sofia_glue_execute_sql(sofia_profile_t *profile, char **sqlp, switch_bool_t dyn)
+void sofia_glue_execute_sql(sofia_profile_t *profile, char **sqlp, switch_bool_t sql_already_dynamic)
 {
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	char *d_sql = NULL, *sql;
@@ -2496,7 +2496,7 @@
 	sql = *sqlp;
 	
 	if (profile->sql_queue) {
-		if (dyn) {
+		if (sql_already_dynamic) {
 			d_sql = sql;
 		} else {
 			d_sql = strdup(sql);
@@ -2504,19 +2504,19 @@
 
 		switch_assert(d_sql);
 		status = switch_queue_trypush(profile->sql_queue, d_sql);
+	} else if (sql_already_dynamic) {
+		d_sql = sql;
 	}
 	
-	if (status == SWITCH_STATUS_SUCCESS) {
-		if (dyn) {
-			*sqlp = NULL;
-		}
-	} else {
-		if (!dyn) {
-			switch_safe_free(d_sql);
-		}
+	if (status != SWITCH_STATUS_SUCCESS) {
 		sofia_glue_actually_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
 	}
 
+	switch_safe_free(d_sql);		
+
+	if (sql_already_dynamic) {
+		*sqlp = NULL;
+	}
 }
 
 void sofia_glue_actually_execute_sql(sofia_profile_t *profile, switch_bool_t master, char *sql, switch_mutex_t *mutex)



More information about the Freeswitch-svn mailing list