Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42839 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63292 invoked from network); 26 Jan 2009 01:12:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2009 01:12:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=giovanni@giacobbi.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=giovanni@giacobbi.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain giacobbi.net from 62.149.226.38 cause and error) X-PHP-List-Original-Sender: giovanni@giacobbi.net X-Host-Fingerprint: 62.149.226.38 host38-226-149-62.serverdedicati.aruba.it Linux 2.5 (sometimes 2.4) (4) Received: from [62.149.226.38] ([62.149.226.38:54216] helo=lowca.thgnet.it) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/62-55096-B0E0D794 for ; Sun, 25 Jan 2009 20:12:44 -0500 Received: from lowca.thgnet.it (lowca [127.0.0.1]) by lowca.thgnet.it (8.12.11.20060308/8.12.11) with ESMTP id n0Q1CSPS003888; Mon, 26 Jan 2009 02:12:28 +0100 Received: (from johnny@localhost) by lowca.thgnet.it (8.12.11.20060308/8.12.11/Submit) id n0Q1CSUi003887; Mon, 26 Jan 2009 02:12:28 +0100 Date: Mon, 26 Jan 2009 02:12:28 +0100 To: internals@lists.php.net Cc: dmitry@php.net Message-ID: <20090126011227.GA3825@lowca.thgnet.it> References: <20090125214352.GA3531@lowca.thgnet.it> <7f3ed2c30901251406i75307f1eh5dd6259d38ed63ce@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f3ed2c30901251406i75307f1eh5dd6259d38ed63ce@mail.gmail.com> User-Agent: Mutt/1.4.2.1i Subject: Re: [PHP-DEV] Bug in HTTP stream context causes problems in SoapClient/get_sdl() From: giovanni@giacobbi.net (Giovanni Giacobbi) On Sun, Jan 25, 2009 at 11:06:51PM +0100, Hannes Magnusson wrote: > > > > $opts = array('http' => array('method' => "GET", 'header' => "Accept-language: en\r\nConnection: close\r\n")); > > $context = stream_context_create($opts); > > stream_context_set_option($context, "http", "protocol_version", 1.1); > > fpassthru(fopen('http://localhost/ws/catalog?wsdl', 'r', false, $context)); > > ?> > > Changing the protocol version is "at your own risk". > If you want a full real HTTP support, you have to use the pecl/http extension. > Please note that the code above is only as proof of concept, because it reproduces what is *currently doing* php_sdl.c:3193, get_sdl() function. Actually, after further investigation I found that this bug was introduced with 1.114 by dmitry, fixing bug #43069. So, if I understood correctly the situation is the following: 1) HTTP stream context does NOT support chunked encoding, so you don't consider it a bug 2) SoapClient currently uses HTTP stream context forcing HTTP/1.1 thus enabling possible chunked encoding result 3) #43069 should then be reopened waiting for a different solution. 3bis) The workaround proposed in the last comment of the bug report works, but as SoapClient is using an unsupported feature, it should be the other way around: by default 1.0 (as it is in PHP 5.2) and then it can be forced to 1.1 php side. IMHO the only clean solution I can see is by implementing the chunked encoding to HTTP context. @William: I'm not sure I understand your reply: Apache#1 (the one running my test code) has nothing to do in all of this, because PHP is opening a raw socket and communicating on its own with Apache#2 (the one outputting the wsdl with chunked encoding). Thus PHP has to deal with this by itself, you cannot consider it a misconfiguration of Apache#2, because it is legitimately using the HTTP protocol. -- Giovanni Giacobbi