diff options
| author | Sascha Schumann <sas@php.net> | 1999-09-11 23:47:16 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 1999-09-11 23:47:16 +0000 |
| commit | f040ce584d1509d61e96fa503b611e14685e71db (patch) | |
| tree | 30408a76ba71e54c1ad66c90c495bb93b5321335 /output.c | |
| parent | 9706aa1daa3008c1352cd53023355041136a0da5 (diff) | |
| download | php-git-f040ce584d1509d61e96fa503b611e14685e71db.tar.gz | |
add transparent session id propagation
this uses a custom scanner which detects relative URIs and changes
them appropiately.
must be explicitly enabled with --enable-trans-sid
(normal case is not affected, since session_adapt_uris defaults to
void statement. Compiler should eliminate dead code in output.c then.)
Diffstat (limited to 'output.c')
| -rw-r--r-- | output.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -20,6 +20,7 @@ #include "php.h" #include "ext/standard/head.h" +#include "ext/session/php_session.h" #include "SAPI.h" /* output functions */ @@ -189,17 +190,31 @@ static int zend_ub_body_write_no_header(const char *str, uint str_length) static int zend_ub_body_write(const char *str, uint str_length) { + char *newstr = NULL; + uint new_length; + int result = 0; SLS_FETCH(); if (SG(request_info).headers_only) { zend_bailout(); } if (php3_header()) { + session_adapt_uris(str, str_length, &newstr, &new_length); + + if (newstr) { + str = newstr; + str_length = new_length; + } + zend_body_write = zend_ub_body_write_no_header; - return zend_header_write(str, str_length); - } else { - return 0; + result = zend_header_write(str, str_length); + + if (newstr) { + free(newstr); + } } + + return result; } |
