Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42073 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48858 invoked from network); 28 Nov 2008 17:24:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2008 17:24:45 -0000 Authentication-Results: pb1.pair.com header.from=thetaphi@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=thetaphi@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 80.190.230.99 as permitted sender) X-PHP-List-Original-Sender: thetaphi@php.net X-Host-Fingerprint: 80.190.230.99 www.troja.net Linux 2.5 (sometimes 2.4) (4) Received: from [80.190.230.99] ([80.190.230.99:50129] helo=mail.troja.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/AA-27999-C5920394 for ; Fri, 28 Nov 2008 12:24:45 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id A4C4C4D6E4; Fri, 28 Nov 2008 18:24:41 +0100 (CET) Received: from mail.troja.net ([127.0.0.1]) by localhost (cyca.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00344-10; Fri, 28 Nov 2008 18:24:39 +0100 (CET) Received: from VEGA (port-83-236-62-11.dynamic.qsc.de [83.236.62.11]) (using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTP id 6A1844D6E2; Fri, 28 Nov 2008 18:24:39 +0100 (CET) To: "'Lukas Kahwe Smith'" , "'Arnaud Le Blanc'" Cc: "'Uwe Schindler'" , , "'Christian Schmidt'" , "'Alex Leigh'" , "'George Wang'" References: <48FBA987.5030809@peytz.dk> <200811092201.36508.lbarnaud@php.net> <841365F95ED5461292599AE9813EA9FA@VEGA> <200811131448.31004.lbarnaud@php.net> Date: Fri, 28 Nov 2008 18:24:38 +0100 Message-ID: <80159BEEC2384A1789C44A10C420039F@VEGA> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AclRWm6GnI7/KmTWRUGigGdLQaUNHgAIcN1g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Subject: RE: [PHP-DEV] [PATCH] Allow unsetting headers previously set usingheader() From: thetaphi@php.net ("Uwe Schindler") 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 thetaphi@php.net - http://www.php.net NSAPI SAPI developer Bremen, Germany > -----Original Message----- > From: Lukas Kahwe Smith [mailto:mls@pooteeweet.org] > Sent: Friday, November 28, 2008 2:07 PM > To: Arnaud Le Blanc > Cc: Uwe Schindler; internals@lists.php.net; '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 > mls@pooteeweet.org > >