summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-01-10 08:34:28 +0000
committerAntony Dovgal <tony2001@php.net>2006-01-10 08:34:28 +0000
commit92f050786f834575db7e104b346612b23fe92437 (patch)
tree1950cfc7094e464bdce702dc961128d1b07fac4f /ext/oci8/oci8.c
parentf079ef83ab8545227abe938c97d1435f7bca066b (diff)
downloadphp-git-92f050786f834575db7e104b346612b23fe92437.tar.gz
MFH: destroy regular connections in RSHUTDOWN if ZTS is used
this fixes problem with Oracle9 (not Oracle10) and Apache2/worker - connections are not being closed correctly see #35205 and similar issues
Diffstat (limited to 'ext/oci8/oci8.c')
-rw-r--r--ext/oci8/oci8.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 38363f77ac..b8257b6fda 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -88,6 +88,9 @@ static void php_oci_descriptor_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
static void php_oci_collection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
+#ifdef ZTS
+static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC);
+#endif
static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
static int php_oci_connection_close(php_oci_connection * TSRMLS_DC);
@@ -623,6 +626,7 @@ PHP_RSHUTDOWN_FUNCTION(oci)
zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper TSRMLS_CC);
#ifdef ZTS
+ zend_hash_apply(&EG(regular_list), (apply_func_t) php_oci_regular_helper TSRMLS_CC);
php_oci_cleanup_global_handles(TSRMLS_C);
#endif
@@ -1726,4 +1730,21 @@ static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC)
return 0;
} /* }}} */
+#ifdef ZTS
+/* {{{ php_oci_regular_helper()
+ Helper function to close non-persistent connections at the end of request in ZTS mode */
+static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC)
+{
+ php_oci_connection *connection;
+
+ if (le->type == le_connection) {
+ connection = (php_oci_connection *)le->ptr;
+ if (connection) {
+ return 1;
+ }
+ }
+ return 0;
+} /* }}} */
+#endif
+
#endif /* HAVE_OCI8 */