diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2002-01-25 00:43:50 +0000 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2002-01-25 00:43:50 +0000 |
commit | 1ea87faeb12c2287623929b838e289ec7bd22f67 (patch) | |
tree | 061c6e27803580212fb098e8d810bb87f54a94e0 | |
parent | 99d36a7557abae4000737a396fbe520dba5a3547 (diff) | |
download | php-git-1ea87faeb12c2287623929b838e289ec7bd22f67.tar.gz |
Added "auto_reset_presistent" ini entry.
-rw-r--r-- | ext/pgsql/pgsql.c | 7 | ||||
-rw-r--r-- | ext/pgsql/php_pgsql.h | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 0ed858ebc7..ddd7acc8a5 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -291,9 +291,10 @@ static void _free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ 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 @@ void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) 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) { diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 01a8a8f7df..71159b65ea 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -148,6 +148,7 @@ typedef struct { 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; |