summaryrefslogtreecommitdiff
path: root/sapi/tux/php_tux.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2002-07-03 10:42:31 (GMT)
committerSascha Schumann <sas@php.net>2002-07-03 10:42:31 (GMT)
commit9c876ea01ad806ae6e345c5dc0cf252c0ebe8864 (patch)
tree60c5f992ca4a366896c4166747336f79ca7e9164 /sapi/tux/php_tux.c
parentc73733c59acef49b86af5996cb0ec12b970a7759 (diff)
downloadphp-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/tux/php_tux.c')
-rw-r--r--sapi/tux/php_tux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index d2da648..4f0b6e1 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -192,10 +192,12 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC)
{
char buf[BUF_SIZE + 1];
char *p;
-
+ sapi_header_line ctr = {0};
+
+ ctr.line = buf;
+ ctr.line_len = sprintf(buf, "Server: %s", TUXAPI_version);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
- sprintf(buf, "Server: %s", TUXAPI_version);
- sapi_add_header_ex(buf, strlen(buf), 1, 0, 0 TSRMLS_CC);
php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC);
php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_CC);
php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC);