Don't reconnect db on reload unless there was a failure
authorMark Spencer <markster@digium.com>
Thu, 13 Nov 2003 16:25:52 +0000 (16:25 +0000)
committerMark Spencer <markster@digium.com>
Thu, 13 Nov 2003 16:25:52 +0000 (16:25 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax.c
channels/chan_iax2.c

index 4b3b3c1..ce36153 100755 (executable)
@@ -4932,7 +4932,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin){
        ast_destroy(cfg);
 #ifdef MYSQL_FRIENDS
        /* Connect to db if appropriate */
-       if (strlen(mydbname)) {
+       if (!mysql && strlen(mydbname)) {
                mysql = mysql_init(NULL);
                if (!mysql_real_connect(mysql, mydbhost[0] ? mydbhost : NULL, mydbuser, mydbpass, mydbname, 0, NULL, 0)) {
                        memset(mydbpass, '*', strlen(mydbpass));
index 5c986cd..d05e29c 100755 (executable)
@@ -5516,7 +5516,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin){
        set_timing();
 #ifdef MYSQL_FRIENDS
        /* Connect to db if appropriate */
-       if (strlen(mydbname)) {
+       if (!mysql && strlen(mydbname)) {
                mysql = mysql_init(NULL);
                if (!mysql_real_connect(mysql, mydbhost[0] ? mydbhost : NULL, mydbuser, mydbpass, mydbname, 0, NULL, 0)) {
                        memset(mydbpass, '*', strlen(mydbpass));