diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-20 00:57:04 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-20 00:57:04 +0000 |
commit | c028a942f9b8c0e521e6393a8a4e29eff886233c (patch) | |
tree | cf74bfcf28cedab46006947814c0839ea11c3399 /cdr | |
parent | e9b1b115e32fa54ee81bc82f72ca8706bde2a967 (diff) |
if a hostname is not specified, connect over a unix socket instead of
connecting to localhost (issue #7145, Mithraen)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28897 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr')
-rw-r--r-- | cdr/cdr_pgsql.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c index 492301a2d..6af1a93a7 100644 --- a/cdr/cdr_pgsql.c +++ b/cdr/cdr_pgsql.c @@ -222,8 +222,8 @@ static int process_my_load_module(struct ast_config *cfg) tmp = ast_variable_retrieve(cfg,"global","hostname"); if (tmp == NULL) { - ast_log(LOG_WARNING,"PostgreSQL server hostname not specified. Assuming localhost\n"); - tmp = "localhost"; + ast_log(LOG_WARNING,"PostgreSQL server hostname not specified. Assuming unix socket connection\n"); + tmp = ""; /* connect via UNIX-socket by default */ } pghostname = strdup(tmp); if (pghostname == NULL) { @@ -287,10 +287,11 @@ static int process_my_load_module(struct ast_config *cfg) } if (option_debug) { - ast_log(LOG_DEBUG, "cdr_pgsql: got hostname of %s\n", pghostname); + if (ast_strlen_zero(pghostname)) + ast_log(LOG_DEBUG, "cdr_pgsql: using default unix socket\n"); + else + ast_log(LOG_DEBUG, "cdr_pgsql: got hostname of %s\n", pghostname); ast_log(LOG_DEBUG, "cdr_pgsql: got port of %s\n", pgdbport); - if (pgdbsock) - ast_log(LOG_DEBUG, "cdr_pgsql: got sock file of %s\n", pgdbsock); ast_log(LOG_DEBUG, "cdr_pgsql: got user of %s\n", pgdbuser); ast_log(LOG_DEBUG, "cdr_pgsql: got dbname of %s\n", pgdbname); ast_log(LOG_DEBUG, "cdr_pgsql: got password of %s\n", pgpassword); |