Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40818 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42872 invoked from network); 1 Oct 2008 13:16:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2008 13:16:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:27284] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/77-04812-21873E84 for ; Wed, 01 Oct 2008 09:16:03 -0400 Received: from ws.home ([10.1.1.1]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 1 Oct 2008 16:16:09 +0300 Message-ID: <48E3780D.2060805@zend.com> Date: Wed, 01 Oct 2008 17:15:57 +0400 User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: "Brian J. France" CC: internals@lists.php.net, Rasmus Lerdorf References: <1890A80D-FE2B-413C-9B41-C56FB17B865D@firehawksystems.com> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Oct 2008 13:16:09.0726 (UTC) FILETIME=[DE9FF9E0:01C923C7] Subject: Re: [PHP-DEV] ext/soap and http header From: dmitry@zend.com (Dmitry Stogov) Hi Brain, A little bit different patch committed into PHP_5_3 and HEAD. I don't think it's allowed to commit it into PHP_5_2. Please verify, if it works for you. Thanks. Dmitry. Brian J. France wrote: > After some more testing I needed to tweak the patch and the example, > here is version 2. > > $opts = array('http' => array('header' => 'X-foo: bar')); > $ctx = stream_context_create($opts); > > Brian > > > --- ext/soap/php_http.c.orig 2008-09-26 05:39:50.000000000 -0700 > +++ ext/soap/php_http.c 2008-09-26 06:42:34.000000000 -0700 > -391,7 +391,8 @@ > PG(allow_url_fopen) = old_allow_url_fopen; > > if (stream) { > - zval **cookies, **login, **password; > + php_stream_context *context = NULL; > + zval **cookies, **login, **password, **tmpzval = NULL; > int ret = zend_list_insert(phpurl, le_url); > > add_property_resource(this_ptr, "httpurl", ret); > -638,6 +639,19 @@ > proxy_authentication(this_ptr, &soap_headers TSRMLS_CC); > } > > + /* get context to check for http headers */ > + if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr), > + "_stream_context", sizeof("_stream_context"), > (void**)&tmp)) { > + context = php_stream_context_from_zval(*tmp, 0); > + } > + > + /* Send http headers from context */ > + if (context && > + php_stream_context_get_option(context, "http", "header", > &tmpzval) == SUCCESS && > + Z_TYPE_PP(tmpzval) == IS_STRING && Z_STRLEN_PP(tmpzval)) { > + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmpzval), > Z_STRLEN_PP(tmpzval)); > + } > + > /* Send cookies along with request */ > if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", > sizeof("_cookies"), (void **)&cookies) == SUCCESS) { > zval **data;