Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42835 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31985 invoked from network); 25 Jan 2009 22:06:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2009 22:06:57 -0000 Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.159 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 72.14.220.159 fg-out-1718.google.com Received: from [72.14.220.159] ([72.14.220.159:50035] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/3D-55096-F72EC794 for ; Sun, 25 Jan 2009 17:06:56 -0500 Received: by fg-out-1718.google.com with SMTP id 16so3106996fgg.23 for ; Sun, 25 Jan 2009 14:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=orjFsE2jktfqCDKYaxbDGEN/awDWwVKRCdS1o7HucF0=; b=xNKTFKdyVPfb/XEAYBYFziwIsbld99JAoGmmYPkqsCAjMDtAqcusWJdSjb2Ow2XYPb uldGUxcg08bsV53IcwkcqVGycZ8zX/H/NV8rtNBghyjkUvKY5350va5nl92IsAIgG+L7 gNhYa+9dNIYeHaq5I5YyDDhQbZzUAQ6Y98i7w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=j5S9gzJioPPimwOd7XKsTUuoB2An2TLGscSe75g4tD+YRhYMGfRrfAWAHid0qNU6FV LGBw/Hs2DF7YYpGvTKdJ13qzENRqXaxMBGKc66I9Suv95fLhXlirE9HtylMRMXLHvhIA auzihiTNABi1Pl8V9lkA/DHEjtLsqUbKxMqX0= MIME-Version: 1.0 Received: by 10.86.99.9 with SMTP id w9mr3949996fgb.38.1232921212002; Sun, 25 Jan 2009 14:06:52 -0800 (PST) In-Reply-To: <20090125214352.GA3531@lowca.thgnet.it> References: <20090125214352.GA3531@lowca.thgnet.it> Date: Sun, 25 Jan 2009 23:06:51 +0100 Message-ID: <7f3ed2c30901251406i75307f1eh5dd6259d38ed63ce@mail.gmail.com> To: Giovanni Giacobbi Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Bug in HTTP stream context causes problems in SoapClient/get_sdl() From: hannes.magnusson@gmail.com (Hannes Magnusson) On Sun, Jan 25, 2009 at 22:43, Giovanni Giacobbi wrote: > > The problem turned out to be an invalid interpretation of the HTTP/1.1 protocol with "Transfer-Encoding: chunked" by the HTTP stream context, which caused get_sdl() to parse a WSDL including the chunk tags (hex numbers). > > Chunked encoding is used by Apache 2.0 when "Content-Length" is unavailable, the data content being sent is large enough, and the protocol is HTTP/1.1. > PHP streams do not support chunked encoding, and I assume SOAP doesn't either (although it does reinvent bunch of things, I don't think chunked encoding was added). I thought the docs were quite explicit on the subject.. if not, please open a doc bug. > $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. > 2) Without the "Connection: close" header the stream blocks until http timeout. It should instead detect the chunk with 0 bytes and return from the fpassthru(). > That however is a valid bug, which I have actually seen couple of times myself.. never debugged it and just assumed I did something weird :] -Hannes