diff options
author | Sascha Schumann <sas@php.net> | 2002-07-03 10:42:31 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2002-07-03 10:42:31 +0000 |
commit | 9c876ea01ad806ae6e345c5dc0cf252c0ebe8864 (patch) | |
tree | 60c5f992ca4a366896c4166747336f79ca7e9164 /sapi/pi3web | |
parent | c73733c59acef49b86af5996cb0ec12b970a7759 (diff) | |
download | php-git-9c876ea01ad806ae6e345c5dc0cf252c0ebe8864.tar.gz |
Add sapi_header_op interface which supersedes the sapi_add_header and _ex
calls.
Revert the change to the sapi_add_header_ex interface.
Fix various bugs:
1. header("HTTP/1.0 306 foo");
header("Location: absolute-uri");
did not work in combination with several SAPI modules, because
http_status_line was never properly reset. And thus, all SAPI
modules which looked at http_status_line ignored the changed
http_response_code.
2. The CGI SAPI did not send out the HTTP status line at all, if
http_status_line had not been set explicitly by calling
header("HTTP/1.0 200 foo");
Diffstat (limited to 'sapi/pi3web')
-rw-r--r-- | sapi/pi3web/pi3web_sapi.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index a7176a1b2a..83fe5fdef7 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -422,9 +422,14 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB) }; }; break; - case PHP_MODE_INDENT: - header_line = (char *)estrdup("Content-Type: text/plain"); - sapi_add_header_ex(header_line, strlen(header_line), 1, 1, 0 TSRMLS_CC); + case PHP_MODE_INDENT: { + sapi_header_line ctr = {0}; + + ctr.line = "Content-Type: text/plain"; + ctr.line_len = strlen(ctr.line); + + sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); + } if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) { zend_indent(); @@ -433,7 +438,6 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB) { iRet = PIAPI_ERROR; }; - efree(header_line); break; case PHP_MODE_LINT: iRet = (php_lint_script(&file_handle TSRMLS_CC) == SUCCESS) ? |