[svn-commits] tilghman: branch 1.6.2 r265895 - in /branches/1.6.2: ./ configs/ res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 26 11:15:42 CDT 2010


Author: tilghman
Date: Wed May 26 11:15:40 2010
New Revision: 265895

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=265895
Log:
Merged revisions 265894 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r265894 | tilghman | 2010-05-26 11:14:48 -0500 (Wed, 26 May 2010) | 8 lines
  
  Construct socket name, according to the Postgres docs, and document as such.
  
  (closes issue #17392)
   Reported by: dps
   Patches: 
         20100525__issue17392.diff.txt uploaded by tilghman (license 14)
   Tested by: dps
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/configs/res_pgsql.conf.sample
    branches/1.6.2/res/res_config_pgsql.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/configs/res_pgsql.conf.sample
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/configs/res_pgsql.conf.sample?view=diff&rev=265895&r1=265894&r2=265895
==============================================================================
--- branches/1.6.2/configs/res_pgsql.conf.sample (original)
+++ branches/1.6.2/configs/res_pgsql.conf.sample Wed May 26 11:15:40 2010
@@ -13,6 +13,13 @@
 dbuser=asterisk
 dbpass=password
 ;
+; dbsock is specified as the directory where the socket file may be found. The
+; actual socket is constructed as a combination of dbsock and dbport.  For
+; example, the values of '/tmp' and '5432', respectively, will specify a socket
+; file of '/tmp/.s.PGSQL.5432'.
+; 
+;dbsock=/tmp
+;
 ; requirements - At startup, each realtime family will make requirements
 ; on the backend.  There are several strategies for handling requirements:
 ; warn        - Warn if the required column does not exist.

Modified: branches/1.6.2/res/res_config_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/res/res_config_pgsql.c?view=diff&rev=265895&r1=265894&r2=265895
==============================================================================
--- branches/1.6.2/res/res_config_pgsql.c (original)
+++ branches/1.6.2/res/res_config_pgsql.c Wed May 26 11:15:40 2010
@@ -1391,8 +1391,8 @@
 		/* No socket needed */
 	} else if (!(s = ast_variable_retrieve(config, "general", "dbsock"))) {
 		ast_log(LOG_WARNING,
-				"PostgreSQL RealTime: No database socket found, using '/tmp/pgsql.sock' as default.\n");
-		strcpy(dbsock, "/tmp/pgsql.sock");
+				"PostgreSQL RealTime: No database socket found, using '/tmp/.s.PGSQL.%d' as default.\n", dbport);
+		strcpy(dbsock, "/tmp");
 	} else {
 		ast_copy_string(dbsock, s, sizeof(dbsock));
 	}
@@ -1453,7 +1453,7 @@
 		struct ast_str *connInfo = ast_str_create(32);
 
 		ast_str_set(&connInfo, 0, "host=%s port=%d dbname=%s user=%s",
-			dbhost, dbport, my_database, dbuser);
+			S_OR(dbhost, dbsock), dbport, my_database, dbuser);
 		if (!ast_strlen_zero(dbpass))
 			ast_str_append(&connInfo, 0, " password=%s", dbpass);
 




More information about the svn-commits mailing list