Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33001 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45878 invoked by uid 1010); 1 Nov 2007 23:09:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 45863 invoked from network); 1 Nov 2007 23:09:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2007 23:09:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=dz@bitxtender.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dz@bitxtender.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain bitxtender.com from 80.237.132.12 cause and error) X-PHP-List-Original-Sender: dz@bitxtender.com X-Host-Fingerprint: 80.237.132.12 wp005.webpack.hosteurope.de Received: from [80.237.132.12] ([80.237.132.12:49318] helo=wp005.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/79-02860-2CC5A274 for ; Thu, 01 Nov 2007 18:09:54 -0500 Received: from [85.183.90.3] (helo=[10.1.1.120]); authenticated by wp005.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:RC4-SHA:128) id 1InjAd-0005yY-Ju; Fri, 02 Nov 2007 00:09:51 +0100 Message-ID: <14EEDAC5-1F44-497C-B3F7-EDC9CD61A147@bitxtender.com> To: PHP Internals In-Reply-To: <87A052F5-4285-4A16-8566-40DFB845C9B9@bitxtender.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v912) Date: Fri, 2 Nov 2007 00:09:50 +0100 References: <87A052F5-4285-4A16-8566-40DFB845C9B9@bitxtender.com> X-Mailer: Apple Mail (2.912) X-bounce-key: webpack.hosteurope.de;dz@bitxtender.com;1193958594;586e4829; Subject: Re: [PHP-DEV] [Patch] http_fopen_wrapper.c and allowing any response code w/o warning From: dz@bitxtender.com (=?ISO-8859-1?Q?David_Z=FClke?=) This is probably better: if (options & STREAM_ONLY_GET_HEADERS || =20 (php_stream_context_get_option(context, "http", "ignore_errors", =20 &tmpzval) =3D=3D SUCCESS && Z_BVAL_PP(tmpzval))) { - David Am 02.11.2007 um 00:06 schrieb David Z=FClke: > Hi folks, > > I've recently played with CouchDB, which is a document database with =20= > a RESTful HTTP interface. > > I noticed, however, that there is no way to prevent PHP from =20 > throwing a warning on response codes other than 200, 206, 301, 302 =20 > and 303. > > Something like 201 Created throws a warning, for example. > > But I'm not sure if simply adding that one to the list is the proper =20= > way forward, as I imagine there are many situations when you just =20 > want to get the response content and look at the headers afterwards =20= > (w/ stream_get_meta_data). So I looked at the code and came up with =20= > this change for http_fopen_wrapper.c line 547 = (http://lxr.php.net/source/php-src/ext/standard/http_fopen_wrapper.c#547=20= > ): > > if ((options & STREAM_ONLY_GET_HEADERS) || =20 > (php_stream_context_get_option(context, "http", "ignore_errors", =20 > &tmpzval) =3D=3D SUCCESS && Z_TYPE_PP(tmpzval) =3D=3D IS_BOOL && =20 > Z_BVAL(retval))) { > > So when the option "ignore_errors" is set for HTTP on the context, =20 > no error will be thrown, and the response body is returned properly. > > Is that a reasonable idea? I'm not entirely sure about the =20 > "ignore_errors" name, maybe someone has a better suggestion. > > I'd be happy to supply a full patch, but I wanted to hear if anyone =20= > has thoughts on this first. > > Cheers, > > David > > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >