diff options
author | Zeev Suraski <zeev@php.net> | 2001-08-26 11:49:43 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-08-26 11:49:43 +0000 |
commit | d697a558ac5e06ea1e487d4cd5192fa53b332407 (patch) | |
tree | 7827586452ab359092a0f35c2e4b446a2d08f232 /ext | |
parent | 5d451c9885c3983eb83ce662e25a4699035cf20c (diff) | |
download | php-git-d697a558ac5e06ea1e487d4cd5192fa53b332407.tar.gz |
Fix my session updates.
trans_sid handling will no longer slow down performance unless a session
is actually in use.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/session/session.c | 28 | ||||
-rw-r--r-- | ext/standard/url_scanner.c | 4 | ||||
-rw-r--r-- | ext/standard/url_scanner.h | 4 | ||||
-rw-r--r-- | ext/standard/url_scanner_ex.c | 4 | ||||
-rw-r--r-- | ext/standard/url_scanner_ex.h | 4 | ||||
-rw-r--r-- | ext/standard/url_scanner_ex.re | 4 |
6 files changed, 28 insertions, 20 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index 3837fff0cc..759949e5f5 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -83,6 +83,7 @@ php_ps_globals ps_globals; static ps_module *_php_find_ps_module(char *name TSRMLS_DC); static const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC); + static int session_adapt_uris(const char *src, size_t srclen, char **new, size_t *newlen, zend_bool do_flush TSRMLS_DC) { if (PS(define_sid) && (PS(session_status) == php_session_active)) { @@ -94,6 +95,7 @@ static int session_adapt_uris(const char *src, size_t srclen, char **new, size_t } + static void php_session_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) { zend_bool do_flush; @@ -107,19 +109,26 @@ static void php_session_output_handler(char *output, uint output_len, char **han } -static void php_session_start_output_handler(INIT_FUNC_ARGS, uint chunk_size) +static void php_session_start_output_handler(uint chunk_size TSRMLS_DC) { - PHP_RINIT(url_scanner)(INIT_FUNC_ARGS_PASSTHRU); - PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU); + php_url_scanner_activate(TSRMLS_C); + php_url_scanner_ex_activate(TSRMLS_C); php_start_ob_buffer(NULL, chunk_size TSRMLS_CC); php_ob_set_internal_handler(php_session_output_handler, chunk_size TSRMLS_CC); } +static void php_session_activate(TSRMLS_D) +{ +} + + + + static void php_session_end_output_handler(SHUTDOWN_FUNC_ARGS) { - PHP_RSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_RSHUTDOWN(url_scanner)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + php_url_scanner_ex_deactivate(TSRMLS_C); + php_url_scanner_deactivate(TSRMLS_C); } @@ -923,7 +932,10 @@ static void php_session_start(TSRMLS_D) REGISTER_STRING_CONSTANT("SID", empty_string, 0); PS(define_sid) = define_sid; - PS(session_status)= php_session_active; + PS(session_status) = php_session_active; + if (!send_cookie && PS(use_trans_sid)) { + php_session_start_output_handler(4096 TSRMLS_CC); + } php_session_cache_limiter(TSRMLS_C); php_session_initialize(TSRMLS_C); @@ -1394,10 +1406,6 @@ PHP_RINIT_FUNCTION(session) php_session_start(TSRMLS_C); } - if (PS(use_trans_sid)) { - php_session_start_output_handler(INIT_FUNC_ARGS_PASSTHRU, 4096); - } - return SUCCESS; } diff --git a/ext/standard/url_scanner.c b/ext/standard/url_scanner.c index b316cee866..681f3e0966 100644 --- a/ext/standard/url_scanner.c +++ b/ext/standard/url_scanner.c @@ -32,14 +32,14 @@ #define BUFSIZE 256 #endif -PHP_RINIT_FUNCTION(url_scanner) +int php_url_scanner_activate(TSRMLS_D) { url_adapt(NULL,0,NULL,NULL); return SUCCESS; } -PHP_RSHUTDOWN_FUNCTION(url_scanner) +int php_url_scanner_deactivate(TSRMLS_D) { url_adapt(NULL,0,NULL,NULL); return SUCCESS; diff --git a/ext/standard/url_scanner.h b/ext/standard/url_scanner.h index ec615fdcef..84c4c66c78 100644 --- a/ext/standard/url_scanner.h +++ b/ext/standard/url_scanner.h @@ -20,8 +20,8 @@ #ifndef URI_SCANNER_H #define URI_SCANNER_H -PHP_RINIT_FUNCTION(url_scanner); -PHP_RSHUTDOWN_FUNCTION(url_scanner); +int php_url_scanner_activate(TSRMLS_D); +int php_url_scanner_deactivate(TSRMLS_D); char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen); diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index e3ed2ca95b..4f227f7c73 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -860,7 +860,7 @@ char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char return ctx->result.c; } -PHP_RINIT_FUNCTION(url_scanner) +int php_url_scanner_ex_activate(TSRMLS_D) { url_adapt_state_ex_t *ctx; @@ -871,7 +871,7 @@ PHP_RINIT_FUNCTION(url_scanner) return SUCCESS; } -PHP_RSHUTDOWN_FUNCTION(url_scanner) +int php_url_scanner_ex_deactivate(TSRMLS_D) { url_adapt_state_ex_t *ctx; diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index 7a90a6d7bf..b8ca4d690c 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -21,8 +21,8 @@ PHP_MINIT_FUNCTION(url_scanner_ex); PHP_MSHUTDOWN_FUNCTION(url_scanner_ex); -PHP_RSHUTDOWN_FUNCTION(url_scanner_ex); -PHP_RINIT_FUNCTION(url_scanner_ex); +int php_url_scanner_ex_activate(TSRMLS_D); +int php_url_scanner_ex_deactivate(TSRMLS_D); char *url_adapt_ext_ex(const char *src, size_t srclen, const char *name, const char *value, size_t *newlen, zend_bool do_flush TSRMLS_DC); diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 31809471df..5074fa66bd 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -376,7 +376,7 @@ char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char return ctx->result.c; } -PHP_RINIT_FUNCTION(url_scanner) +int php_url_scanner_ex_activate(TSRMLS_D) { url_adapt_state_ex_t *ctx; @@ -387,7 +387,7 @@ PHP_RINIT_FUNCTION(url_scanner) return SUCCESS; } -PHP_RSHUTDOWN_FUNCTION(url_scanner) +int php_url_scanner_ex_deactivate(TSRMLS_D) { url_adapt_state_ex_t *ctx; |