Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39359 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70336 invoked from network); 26 Jul 2008 20:53:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2008 20:53:20 -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.214.239 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.214.239 hu-out-0506.google.com Received: from [72.14.214.239] ([72.14.214.239:29375] helo=hu-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/50-02589-EBE8B884 for ; Sat, 26 Jul 2008 16:53:19 -0400 Received: by hu-out-0506.google.com with SMTP id 36so701217hui.13 for ; Sat, 26 Jul 2008 13:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=wweQcFNDKlUaqJWw/2GcfAdKHPr8lCjgcgK7eDIrh3U=; b=u5eMa7y0mP59F8u/PRbdEzKGYK+70xl577y9w083yxJj9N62AQZ6TwIzZygOEf1vay 6krol9LEzRxLtsi5enc8u54RujI4vylAKFkyTrL5MvBlOXke9ml0CZM7gicYMwCfckd6 7anSbwEWthDQDYpKr9XCKbYexFk+xcaR6D+Kw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=am3tLgqUe2Bz+tK+k69WmyIlpYj1yH/7iuAqZ019uWe4rO0XONUjBCSqS/nNW+IN6I j8ZjZBZ2Da3Qo/s4IpESYkiwkUETGtceeIi9UTc9x45wiKRFvYLZBnoGYWlD5OpcgB8/ IsndnpAvEyBe7sJpLIoOXbK9AqUcB1qE/pfBw= Received: by 10.103.213.19 with SMTP id p19mr1957609muq.70.1217105595448; Sat, 26 Jul 2008 13:53:15 -0700 (PDT) Received: by 10.103.248.20 with HTTP; Sat, 26 Jul 2008 13:53:15 -0700 (PDT) Message-ID: <7f3ed2c30807261353v1fc3505en1d2bc922671cdb30@mail.gmail.com> Date: Sat, 26 Jul 2008 22:53:15 +0200 To: "=?ISO-8859-1?Q?David_Z=FClke?=" Cc: "Noah Fontes" , "PHP Developers Mailing List" , "Lukas Kahwe Smith" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4885E513.6080702@bitextender.com> <48864FA5.6050104@zend.com> <48876D27.6030407@bitextender.com> <7f3ed2c30807250353g6fb37d8kc6432634173427a6@mail.gmail.com> Subject: Re: [PHP-DEV] Patch for HTTP successful status codes From: hannes.magnusson@gmail.com ("Hannes Magnusson") On Sat, Jul 26, 2008 at 22:37, David Z=FClke = wrote: > Am 25.07.2008 um 12:53 schrieb Hannes Magnusson: > >> I think changing all 3xx status codes to be success is a slightly more >> bc break then you think. >> >> A simple example: >> I do a file_get_contents() request. Store it in a local buffer. >> I do a second file_get_contents(), get a error (304) back, print out my >> buffer. >> >> Now, in 5.3.0 the 304 is treated as success so I naturally discard my >> buffer and print the results of the new request... Whooopsy, there was >> no data :( > > The problem with the current behavior is that a warning is thrown, but th= e > response is empty and there is no way to even tell the status code that y= ou > got back. Sure, there is the "ignore_errors" option in 5.3 that I propose= d > back in November (which Sara committed, thanks again), but still... http://no.php.net/manual/en/reserved.variables.httpresponseheader.php ? afaik this variable is always set, especially on errors. > Also, to get back a 304, you'd have to send ETag and If-Modified-Since > headers anyway, since it is only returned for such conditional requests -= it > won't happen in normal situations! Why not? You try obviously set these headers to spare you needing to fetch the content again if it hasn't changed. > I'm relatively indifferent on this. For purposes where I need access to t= he > info, I'll always set the "ignore_errors" option anyway. But if I had to > choose, I'd say include 3xx codes in the "successful" group. Like mike put it on IRC: "Ahh shit. You should be using pecl/http anyway" describes the situation pretty well. PHP only offers half baked implementation which is very useful for regular joe, but as soon as you need to do anything fancy with it you are shit out of luck. I'm fine with just documenting this change in the "bc break" section, but this is such a subtle change that will be very hard to debug though :] -Hannes