From: Uwe Schindler Date: Wed, 25 Feb 2009 19:52:06 +0000 (+0000) Subject: Fix Bug 47495: Keep header in internal list after add, so headers_list() works correc... X-Git-Tag: php-5.2.10RC1~314 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b2874eafd740c2e6b09d7a442b69faecd3763b6;p=php Fix Bug 47495: Keep header in internal list after add, so headers_list() works correctly. Other SAPIs have the same problem, but PHP 5.3 fixes this more elegant. --- diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index b76b0e5b17..62564e7fbd 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -473,7 +473,7 @@ static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_heade char *header_name, *header_content, *p; nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - header_name = sapi_header->header; + header_name = nsapi_strdup(sapi_header->header); header_content = p = strchr(header_name, ':'); if (p == NULL) { efree(sapi_header->header); @@ -497,9 +497,9 @@ static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_heade pblock_nvinsert(header_name, header_content, rc->rq->srvhdrs); } - sapi_free_header(sapi_header); + nsapi_free(header_name); - return 0; /* don't use the default SAPI mechanism, NSAPI duplicates this functionality */ + return SAPI_HEADER_ADD; } static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)