From 9c876ea01ad806ae6e345c5dc0cf252c0ebe8864 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Wed, 3 Jul 2002 10:42:31 +0000 Subject: 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"); --- sapi/tux/php_tux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sapi/tux/php_tux.c') diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c index d2da64882a..4f0b6e17db 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); -- cgit v1.2.1