Fix reconnecting to pgsql database after connection loss.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 13 Feb 2012 17:25:41 +0000 (17:25 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 13 Feb 2012 17:25:41 +0000 (17:25 +0000)
commita955a4770fcdd7874e1337e7df694bcd293e020e
tree7518b749b0e461300ca5733baea523fc24331c11
parentfd100261f3e9926e83dfa77847028236027fb7cb
Fix reconnecting to pgsql database after connection loss.

There can only be one database connection in res_config_pgsql just like
res_config_sqlite.  If the connection is lost, the connection may not get
reestablished to the same database if the res_pgsql.conf and
extconfig.conf files are inconsistent.

* Made only use the configured database from res_pgsql.conf.

* Fixed potential buffer overwrite of last[] in config_pgsql().

(closes issue ASTERISK-16982)
Reported by: german aracil boned

Review: https://reviewboard.asterisk.org/r/1731/
........

Merged revisions 354953 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 354959 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
configs/extconfig.conf.sample
res/res_config_pgsql.c