[PHP4BETA] CVS update: php4

From: Date: Tue, 11 May 1999 18:36:36 +0000
Subject: [PHP4BETA] CVS update: php4
Groups: php.version4 
Request: Send a blank email to php-version4+get-772@lists.php.net to get a copy of this message
Date: Tuesday May 11, 1999 @ 14:36 Author: zeev Update of /repository/php4 In directory php:/tmp/cvs-serv10407 Modified Files: SAPI.c mod_php3.c Log Message: Handle the Location: header centrally for all SAPI modules. Index: php4/SAPI.c diff -u php4/SAPI.c:1.15 php4/SAPI.c:1.16 --- php4/SAPI.c:1.15 Mon May 10 15:48:23 1999 +++ php4/SAPI.c Tue May 11 14:36:35 1999 @@ -121,6 +121,7 @@ { int retval; sapi_header_struct sapi_header; + char *colon_offset; SLS_FETCH(); if (SG(headers_sent)) { @@ -132,6 +133,17 @@ sapi_header.header = header_line; sapi_header.header_len = header_line_len; + colon_offset = strchr(header_line, ':'); + if (colon_offset) { + *colon_offset = 0; + if (!STRCASECMP(header_line, "Content-Type")) { + SG(sapi_headers).send_default_content_type = 0; + } else if (!STRCASECMP(header_line, "Location")) { + SG(sapi_headers).http_response_code = 302; /* redirect */ + } + *colon_offset = ':'; + } + if (sapi_module.header_handler) { retval = sapi_module.header_handler(&sapi_header, &SG(sapi_headers) SLS_CC); } else { @@ -142,15 +154,6 @@ zend_llist_clean(&SG(sapi_headers).headers); } if (retval & SAPI_HEADER_ADD) { - char *colon_offset = strchr(header_line, ':'); - - if (colon_offset) { - *colon_offset = 0; - if (!STRCASECMP(header_line, "Content-Type")) { - SG(sapi_headers).send_default_content_type = 0; - } - *colon_offset = ':'; - } zend_llist_add_element(&SG(sapi_headers).headers, (void *) &sapi_header); } return SUCCESS; Index: php4/mod_php3.c diff -u php4/mod_php3.c:1.18 php4/mod_php3.c:1.19 --- php4/mod_php3.c:1.18 Tue May 11 08:52:17 1999 +++ php4/mod_php3.c Tue May 11 14:36:35 1999 @@ -28,7 +28,7 @@ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php3.c,v 1.18 1999/05/11 12:52:17 zeev Exp $ */ +/* $Id: mod_php3.c,v 1.19 1999/05/11 18:36:35 zeev Exp $ */ #include "httpd.h" #include "http_config.h" @@ -152,8 +152,6 @@ if (!strcasecmp(header_name, "Content-Type")) { r->content_type = pstrdup(r->pool, header_content); - } else if (!strcasecmp(header_name, "Location")) { - r->status = REDIRECT; } else { table_set(r->headers_out, header_name, header_content); } @@ -168,6 +166,7 @@ int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC) { + ((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code; send_http_header((request_rec *) SG(server_context)); return SAPI_HEADER_SENT_SUCCESSFULLY; } -- PHP 4 Beta

« previous php.version4 (#772) next »