From: Brian West Date: Fri, 13 Nov 2009 17:55:52 +0000 (+0000) Subject: begin and commit in sep stmts X-Git-Tag: v1.0.6~1416 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dfcff4303bd991245912b01f5452a6ed31aa00e;p=thirdparty%2Ffreeswitch.git begin and commit in sep stmts git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15462 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 8e05059c7c..cea5db904f 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -915,8 +915,9 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread switch_mutex_lock(profile->ireg_mutex); - sprintf(sqlbuf + len, "begin;\n"); - len += 7; + + sprintf(sqlbuf, "begin;\n"); + sofia_glue_actually_execute_sql(profile, sqlbuf, NULL); while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) { char *sql = (char *) pop; @@ -940,10 +941,13 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread free(pop); } - sprintf(sqlbuf + len, "commit;\n"); - //printf("TRANS:\n%s\n", sqlbuf); sofia_glue_actually_execute_sql(profile, sqlbuf, NULL); + + sprintf(sqlbuf, "commit;\n"); + sofia_glue_actually_execute_sql(profile, sqlbuf, NULL); + + switch_mutex_unlock(profile->ireg_mutex); loop_count = 0; }