Just one question here:
When implementing this into NSAPI, I found the following problem:
NSAPI does not directly allows to remove all headers, you can only do this
step by step. So there are three possibilities to ship around this problem:
a) when SAPI_HEADER_DELETE_ALL is given, in header_handler, do the following
(using the sapi_header_struct given as last parameter):
zend_llist_apply(sapi_headers->headers, (llist_apply_func_t)
php_nsapi_remove_header TSRMLS_CC);
with:
static int php_nsapi_remove_header(sapi_header_struct *sapi_header
TSRMLS_DC)
{
char *header_name, *p;
nsapi_request_context *rc = (nsapi_request_context
*)SG(server_context);
header_name = nsapi_strdup(sapi_header->header);
if (p = strchr(header_name, ':')) *p = 0;
...
param_free(pblock_remove(header_name, rc->rq->srvhdrs));
nsapi_free(header_name);
return ZEND_HASH_APPLY_KEEP;
}
This would remove all headers, set by PHP. Headers embedded by the server
itself would not be deleted (e.g. "Server:" etc.)
b) Use some "hack" to get rid of all headers from the server's hashtable
(like apr_table_clear()). This would remove all headers and also some
important headers set by the server itself (like Server:, Chunked response
headers, etc). I am not sure if this would be good, in my opinion
SAPI_HEADER_DELETE_ALL should only remove headers set by PHP itself! What
does the other SAPI developers think, is it safe to remove apaches default
headers????? I am not sure and tend to say: NO!
c) Completely ignore sapi_header_handler like in CGI and set the headers
later in sapi_send_headers() using the given struct with zend_llist_apply().
Then I do not have to take care of adding/removing headers, I set them to
Sun Webserver shortly before starting the response. Why the difference
between header_handler and send_headers? Is it ok to remove header_handler
(like in CGI) and simply feed all headers in send_headers? This would make
life for SAPI developers easier (also maybe in Apache). What is the idea to
respond after each header change?
What do you think?
-----
Uwe Schindler
[EMAIL PROTECTED] - http://www.php.net
NSAPI SAPI developer
Bremen, Germany
> -----Original Message-----
> From: Lukas Kahwe Smith [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 28, 2008 2:07 PM
> To: Arnaud Le Blanc
> Cc: Uwe Schindler; [email protected]; 'Christian Schmidt'; Alex
> Leigh; George Wang
> Subject: Re: [PHP-DEV] [PATCH] Allow unsetting headers previously set
> usingheader()
>
>
> On 13.11.2008, at 14:48, Arnaud Le Blanc wrote:
>
> > Hi,
> >
> > Committed, thanks Christian :)
> >
> > apache2handler, apache2filter, apache, apache_hooks, cli and cgi
> > SAPIs have
> > been updated.
> >
> > The following SAPIs need to be updated in PHP_5_3 and HEAD:
> > aolserver, continuity, litespeed, nsapi, caudium, phttpd, roxen.
> > (I'm CC-ing
> > known maintainers)
> >
> > More informations on the change can be found in the commit message:
> > http://news.php.net/php.cvs/54228
>
>
> err .. whats the status here?
>
> regards,
> Lukas Kahwe Smith
> [EMAIL PROTECTED]
>
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php