mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-15 17:27:02 +00:00
Don't reconnect db on reload unless there was a failure
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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
Block a user