summaryrefslogtreecommitdiff
path: root/ext/oci8
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2000-03-06 08:02:15 +0000
committerThies C. Arntzen <thies@php.net>2000-03-06 08:02:15 +0000
commitad5b022ed13c7c46380cd9d278f30eda6ae677fa (patch)
tree090706bcfc7a28bee462f092585e791e3c658104 /ext/oci8
parent5e55e47f7f32c40c446f2543cbc0002b52db47dd (diff)
downloadphp-git-ad5b022ed13c7c46380cd9d278f30eda6ae677fa.tar.gz
@- OCINLogon() sessions are now closed again. (Thies)
# happy hacking in hongkong!
Diffstat (limited to 'ext/oci8')
-rw-r--r--ext/oci8/oci8.c15
-rw-r--r--ext/oci8/php_oci8.h1
2 files changed, 9 insertions, 7 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 918f0cee4b..071ec418d3 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -647,6 +647,12 @@ _oci_conn_list_dtor(oci_connection *connection)
oci_debug("START _oci_conn_list_dtor: id=%d",connection->id);
+ if (connection->session->exclusive) {
+ /* exclusive connection created via OCINLogon() close their
+ associated session when destructed */
+ zend_list_delete(connection->session->num);
+ }
+
if (connection->pServiceContext) {
/*
connection->error =
@@ -1843,6 +1849,7 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
session->persistent = persistent;
session->hashed_details = hashed_details;
session->server = server;
+ session->exclusive = exclusive;
/* allocate temporary Service Context */
OCI(error) =
@@ -1924,12 +1931,6 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
if (exclusive) {
psession = session;
- /*
- zend_hash_next_index_insert(OCI(user),
- (void *)session,
- sizeof(oci_session),
- (void**)&psession);
- */
} else {
zend_hash_update(OCI(user),
session->hashed_details,
@@ -1944,7 +1945,7 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
oci_debug("_oci_open_session new sess=%d user=%s",psession->num,username);
- free(session);
+ if (! exclusive) free(session);
return psession;
diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h
index 2e2a754d10..5d889da993 100644
--- a/ext/oci8/php_oci8.h
+++ b/ext/oci8/php_oci8.h
@@ -70,6 +70,7 @@ typedef struct {
int num;
int persistent;
int open;
+ int exclusive;
char *hashed_details;
oci_server *server;
OCISession *pSession;