dect
/
asterisk
Archived
13
0
Fork 0

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:
markster 2003-11-13 16:25:52 +00:00
parent 5cffb53e8e
commit 4872a9e320
2 changed files with 2 additions and 2 deletions

View File

@ -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));

View File

@ -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));