cvs: php4 /ext/pgsql pgsql.c php_pgsql.h
| From: | Yasuo Ohgaki | Date: | Fri, 25 Jan 2002 00:43:50 +0000 |
| Subject: | cvs: php4 /ext/pgsql pgsql.c php_pgsql.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9171@lists.php.net to get a copy of this message | ||
yohgaki Thu Jan 24 19:43:50 2002 EDT
Modified files:
/php4/ext/pgsql pgsql.c php_pgsql.h
Log:
Added "auto_reset_presistent" ini entry.
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.145 php4/ext/pgsql/pgsql.c:1.146
--- php4/ext/pgsql/pgsql.c:1.145 Thu Jan 24 04:27:43 2002
+++ php4/ext/pgsql/pgsql.c Thu Jan 24 19:43:50 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.145 2002/01/24 09:27:43 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.146 2002/01/25 00:43:50 yohgaki Exp $ */
#include <stdlib.h>
@@ -291,9 +291,10 @@
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allow_persistent, php_pgsql_globals, pgsql_globals)
+ STD_PHP_INI_BOOLEAN("pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, php_pgsql_globals, pgsql_globals)
STD_PHP_INI_ENTRY_EX("pgsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_persistent, php_pgsql_globals, pgsql_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX("pgsql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_links, php_pgsql_globals, pgsql_globals, display_link_numbers)
+ STD_PHP_INI_BOOLEAN("pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateBool, auto_reset_persistent, php_pgsql_globals, pgsql_globals)
PHP_INI_END()
/* }}} */
@@ -535,19 +536,17 @@
PGG(num_links)++;
PGG(num_persistent)++;
} else { /* we do */
- php_log_err("CONNECTION IS ALREADY OPENED :)" TSRMLS_CC);
if (Z_TYPE_P(le) != le_plink) {
RETURN_FALSE;
}
/* ensure that the link did not die */
- {
+ if (PGG(auto_reset_persistent)) {
/* need to send & get something from backend to
make sure we catch CONNECTION_BAD everytime */
PGresult *pg_result;
pg_result = PQexec(le->ptr, "select 1");
PQclear(pg_result);
}
- PQconsumeInput(le->ptr);
if (PQstatus(le->ptr)==CONNECTION_BAD) { /* the link died */
if (le->ptr == NULL) {
if (connstring) {
Index: php4/ext/pgsql/php_pgsql.h
diff -u php4/ext/pgsql/php_pgsql.h:1.36 php4/ext/pgsql/php_pgsql.h:1.37
--- php4/ext/pgsql/php_pgsql.h:1.36 Sun Dec 16 19:24:59 2001
+++ php4/ext/pgsql/php_pgsql.h Thu Jan 24 19:43:50 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pgsql.h,v 1.36 2001/12/17 00:24:59 yohgaki Exp $ */
+/* $Id: php_pgsql.h,v 1.37 2002/01/25 00:43:50 yohgaki Exp $ */
#ifndef PHP_PGSQL_H
#define PHP_PGSQL_H
@@ -148,6 +148,7 @@
long num_links,num_persistent;
long max_links,max_persistent;
long allow_persistent;
+ long auto_reset_persistent;
int le_lofp,le_string;
int ignore_notices;
char *last_notice;