From 8c4151ad72b6c5a82b341aaf59d2c31521ca4341 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Thu, 13 Nov 2008 10:14:04 +0000 Subject: Added header_remove() (chsc at peytz dotdk, Arnaud) [DOC] proto void header_remove([string header_name]) Removes an HTTP header previously set using header() The header_name parameter is optionnal, all headers are removed if it is not set [SAPIs] The header_handler callback in sapi_module_struct has been changed, it now take a new argument. When it is set to SAPI_HEADER_DELETE, sapi_header->header is the name of an header, header_handler has to delete it. When it is set to SAPI_HEADER_DELETE_ALL, header_handler has to delete all headers. When sapi_header_op_enum is SAPI_HEADER_ADD or _REPLACE, sapi_header->header is in the form "Name: value", header_handler has to add or replace the given header. In all cases, header_handler must not free sapi_header or sapi_header->header. SAPI_HEADER_ADD must be returned if the header has been added or replaced, or 0 in other cases. --- sapi/cli/php_cli.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 66e206df62..4b9d112ed7 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -347,11 +347,8 @@ static char* sapi_cli_read_cookies(TSRMLS_D) /* {{{ */ } /* }}} */ -static int sapi_cli_header_handler(sapi_header_struct *h, sapi_headers_struct *s TSRMLS_DC) /* {{{ */ +static int sapi_cli_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s TSRMLS_DC) /* {{{ */ { - /* free allocated header line */ - efree(h->header); - /* avoid pushing headers into SAPI headers list */ return 0; } /* }}} */ -- cgit v1.2.1