[PHP4BETA] CVS update: php4/ext/standard

From: Date: Wed, 05 May 1999 18:25:21 +0000
Subject: [PHP4BETA] CVS update: php4/ext/standard
Groups: php.version4 
Request: Send a blank email to php-version4+get-654@lists.php.net to get a copy of this message
Date: Wednesday May 5, 1999 @ 14:25 Author: andi Update of /repository/php4/ext/standard In directory php:/tmp/cvs-serv4330/ext/standard Modified Files: head.c head.h Log Message: Added initial headers support in SAPI *untested* It definitely broke the thread-safe CGI, it may have broken other stuff as well. Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.7 php4/ext/standard/head.c:1.8 --- php4/ext/standard/head.c:1.7 Mon Apr 26 13:26:36 1999 +++ php4/ext/standard/head.c Wed May 5 14:25:20 1999 @@ -26,7 +26,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.7 1999/04/26 17:26:36 zeev Exp $ */ +/* $Id: head.c,v 1.8 1999/05/05 18:25:20 andi Exp $ */ #include <stdio.h> #include "php.h" @@ -76,8 +76,9 @@ } +#ifndef ZTS /* Adds header information */ -void php4i_add_header_information(char *header_information) +void php4i_add_header_information(char *header_information, uint header_length) { char *r; #if APACHE @@ -202,6 +203,12 @@ } #endif } +#else +void php4i_add_header_information(char *header_information, uint header_length) +{ + sapi_add_header(header_information, header_length); +} +#endif /* Implementation of the language Header() function */ @@ -213,12 +220,14 @@ WRONG_PARAM_COUNT; } convert_to_string(arg1); - php4i_add_header_information(arg1->value.str.val); + php4i_add_header_information(arg1->value.str.val, arg1->value.str.len); } + +#ifndef ZTS /* * php3_header() flushes the header info built up using calls to * the Header() function. If type is 1, a redirect to str is done. @@ -384,6 +393,20 @@ PG(header_is_being_sent) = 0; return(1); } +#else +PHPAPI int php3_header() +{ + SLS_FETCH(); + + if (sapi_send_headers()==FAILURE || SG(request_info).headers_only) { + return 0; /* don't allow output */ + } else { + return 1; /* allow output */ + } +} +#endif + + void php3_PushCookieList(char *name, char *value, time_t expires, char *path, char *domain, int secure) { Index: php4/ext/standard/head.h diff -u php4/ext/standard/head.h:1.2 php4/ext/standard/head.h:1.3 --- php4/ext/standard/head.h:1.2 Mon Apr 26 10:00:49 1999 +++ php4/ext/standard/head.h Wed May 5 14:25:20 1999 @@ -56,7 +56,7 @@ extern void php3_Header(INTERNAL_FUNCTION_PARAMETERS); extern void php3_SetCookie(INTERNAL_FUNCTION_PARAMETERS); -void php4i_add_header_information(char *header_information); +void php4i_add_header_information(char *header_information, uint header_length); PHPAPI void php3_noheader(void); PHPAPI int php3_header(void); -- PHP 4 Beta

« previous php.version4 (#654) next »