cvs: /php4 main.c php_globals.h /php4/ext/odbc php_odbc.c /php4/ext/session session.c
| From: | Zeev Suraski | Date: | Sun, 16 Jan 2000 21:04:19 +0000 |
| Subject: | cvs: /php4 main.c php_globals.h /php4/ext/odbc php_odbc.c /php4/ext/session session.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9180@lists.php.net to get a copy of this message | ||
zeev Sun Jan 16 13:04:19 2000 EDT
Modified files:
/php4 main.c php_globals.h
/php4/ext/odbc php_odbc.c
/php4/ext/session session.c
Log:
- Remove the pre-request-shutdown hooks, they should no longer be necessary.
The session module may not work due to an unknown (and until now, IMO, misdiagnosed) problem,
if it does, please report it!
Index: php4/main.c
diff -u php4/main.c:1.178 php4/main.c:1.179
--- php4/main.c:1.178 Sun Jan 16 11:43:32 2000
+++ php4/main.c Sun Jan 16 13:03:48 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.178 2000/01/16 19:43:32 zeev Exp $ */
+/* $Id: main.c,v 1.179 2000/01/16 21:03:48 zeev Exp $ */
#include <stdio.h>
@@ -654,40 +654,7 @@
}
}
-static void php_start_request_hook(void *data)
-{
- php_request_hook *ptr = (php_request_hook *) data;
-
- ptr->func(ptr->userdata);
-}
-
-static void php_execute_pre_request_shutdown(PLS_D)
-{
- if (PG(pre_request_shutdown_ok)) {
- zend_llist_apply(&PG(ll_pre_request_shutdown), php_start_request_hook);
- zend_llist_destroy(&PG(ll_pre_request_shutdown));
- PG(pre_request_shutdown_ok) = 0;
- }
-}
-
-
-void php_register_pre_request_shutdown(void (*func)(void *), void *userdata)
-{
- php_request_hook ptr;
- PLS_FETCH();
- if (!PG(pre_request_shutdown_ok)) {
- zend_llist_init(&PG(ll_pre_request_shutdown), sizeof(php_request_hook), NULL, 0);
- PG(pre_request_shutdown_ok) = 1;
- }
-
- ptr.func = func;
- ptr.userdata = userdata;
-
- zend_llist_add_element(&PG(ll_pre_request_shutdown), &ptr);
-}
-
-
int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC)
{
global_lock();
@@ -772,8 +739,6 @@
ELS_FETCH();
SLS_FETCH();
PLS_FETCH();
-
- php_execute_pre_request_shutdown(PLS_C);
sapi_send_headers();
php_end_ob_buffering(SG(request_info).headers_only?0:1);
Index: php4/php_globals.h
diff -u php4/php_globals.h:1.35 php4/php_globals.h:1.36
--- php4/php_globals.h:1.35 Sun Jan 16 11:43:33 2000
+++ php4/php_globals.h Sun Jan 16 13:03:48 2000
@@ -95,17 +95,8 @@
long max_execution_time;
unsigned char header_is_being_sent;
-
- zend_llist ll_pre_request_shutdown;
-
- zend_bool pre_request_shutdown_ok;
};
-
-typedef struct {
- void (*func)(void *);
- void *userdata;
-} php_request_hook;
#endif /* _PHP_GLOBALS_H */
Index: php4/ext/odbc/php_odbc.c
diff -u php4/ext/odbc/php_odbc.c:1.26 php4/ext/odbc/php_odbc.c:1.27
--- php4/ext/odbc/php_odbc.c:1.26 Sat Jan 15 05:35:06 2000
+++ php4/ext/odbc/php_odbc.c Sun Jan 16 13:03:48 2000
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc.c,v 1.26 2000/01/15 13:35:06 thies Exp $ */
+/* $Id: php_odbc.c,v 1.27 2000/01/16 21:03:48 zeev Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
@@ -410,7 +410,9 @@
return SUCCESS;
}
-void _php_odbc_shutdown(void *data)
+
+#if 0
+static void _php_odbc_shutdown(void *data)
{
ELS_FETCH();
@@ -421,7 +423,9 @@
zend_hash_apply(&EG(regular_list), (int (*)(void *)) _odbc_stmt_cleanup);
}
+#endif
+
PHP_RINIT_FUNCTION(odbc)
{
ODBCLS_FETCH();
@@ -429,7 +433,9 @@
ODBCG(defConn) = -1;
ODBCG(num_links) = ODBCG(num_persistent);
- php_register_pre_request_shutdown(_php_odbc_shutdown, NULL);
+ /* This should no longer be necessary, as hash_apply() is reentrant
+ * php_register_pre_request_shutdown(_php_odbc_shutdown, NULL);
+ */
return SUCCESS;
}
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.97 php4/ext/session/session.c:1.98
--- php4/ext/session/session.c:1.97 Sun Jan 16 12:37:09 2000
+++ php4/ext/session/session.c Sun Jan 16 13:03:49 2000
@@ -101,6 +101,7 @@
PHP_MINIT_FUNCTION(session);
PHP_RINIT_FUNCTION(session);
PHP_MSHUTDOWN_FUNCTION(session);
+PHP_RSHUTDOWN_FUNCTION(session);
PHP_MINFO_FUNCTION(session);
static void php_rinit_session_globals(PSLS_D);
@@ -110,7 +111,7 @@
"Session Management",
session_functions,
PHP_MINIT(session), PHP_MSHUTDOWN(session),
- PHP_RINIT(session), NULL,
+ PHP_RINIT(session), PHP_RSHUTDOWN(session),
PHP_MINFO(session),
STANDARD_MODULE_PROPERTIES,
};
@@ -1178,17 +1179,6 @@
}
-void _php_session_shutdown(void *data)
-{
- PSLS_FETCH();
-
- if(PS(nr_open_sessions) > 0) {
- _php_session_save_current_state(PSLS_C);
- PS(nr_open_sessions)--;
- }
- php_rshutdown_session_globals(PSLS_C);
-}
-
PHP_RINIT_FUNCTION(session)
{
PSLS_FETCH();
@@ -1206,10 +1196,23 @@
_php_session_start(PSLS_C);
}
- php_register_pre_request_shutdown(_php_session_shutdown, NULL);
+ return SUCCESS;
+}
+
+PHP_RSHUTDOWN_FUNCTION(session)
+{
+ PSLS_FETCH();
+
+ if(PS(nr_open_sessions) > 0) {
+ _php_session_save_current_state(PSLS_C);
+ PS(nr_open_sessions)--;
+ }
+ php_rshutdown_session_globals(PSLS_C);
return SUCCESS;
}
+
+
PHP_MINIT_FUNCTION(session)
{