Don't reconnect db on reload unless there was a failure
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1741 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
5cffb53e8e
commit
4872a9e320
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
|
|
Reference in New Issue