cvs: php4 /main SAPI.c SAPI.h

From: Date: Thu, 26 Oct 2000 18:18:21 +0000
Subject: cvs: php4 /main SAPI.c SAPI.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2275@lists.php.net to get a copy of this message
sas Thu Oct 26 11:18:21 2000 EDT Modified files: /php4/main SAPI.c SAPI.h Log: Add sapi_add_header_ex, which lets you specify whether you want to add or replace a header. Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.95 php4/main/SAPI.c:1.96 --- php4/main/SAPI.c:1.95 Fri Oct 20 12:10:27 2000 +++ php4/main/SAPI.c Thu Oct 26 11:18:21 2000 @@ -356,7 +356,7 @@ /* This function expects a *duplicated* string, that was previously emalloc()'d. * Pointers sent to this functions will be automatically freed by the framework. */ -SAPI_API int sapi_add_header(char *header_line, uint header_line_len, zend_bool duplicate) +SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace) { int retval, free_header = 0; sapi_header_struct sapi_header; @@ -390,6 +390,7 @@ sapi_header.header = header_line; sapi_header.header_len = header_line_len; + sapi_header.replace = replace; /* Check the header for a few cases that we have special support for in SAPI */ if (header_line_len>=5 Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.57 php4/main/SAPI.h:1.58 --- php4/main/SAPI.h:1.57 Sun Oct 22 17:52:11 2000 +++ php4/main/SAPI.h Thu Oct 26 11:18:21 2000 @@ -41,6 +41,7 @@ typedef struct { char *header; uint header_len; + zend_bool replace; } sapi_header_struct; @@ -130,7 +131,9 @@ SAPI_API void sapi_deactivate(SLS_D); SAPI_API void sapi_initialize_empty_request(SLS_D); -SAPI_API int sapi_add_header(char *header_line, uint header_line_len, zend_bool duplicate); +SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace); +#define sapi_add_header(header_line, header_line_len, duplicate) \ + sapi_add_header_ex((header_line), (header_line_len), (duplicate), 1) SAPI_API int sapi_send_headers(void); SAPI_API void sapi_free_header(sapi_header_struct *sapi_header); SAPI_API void sapi_handle_post(void *arg SLS_DC);

« previous php.cvs (#2275) next »