Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50914 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34172 invoked from network); 8 Dec 2010 19:13:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2010 19:13:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=clint@ubuntu.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=clint@ubuntu.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ubuntu.com from 65.98.207.160 cause and error) X-PHP-List-Original-Sender: clint@ubuntu.com X-Host-Fingerprint: 65.98.207.160 xenclint.srihosting.com Received: from [65.98.207.160] ([65.98.207.160:60670] helo=xen.spamaps.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/35-04432-DB8DFFC4 for ; Wed, 08 Dec 2010 14:13:02 -0500 Received: from [192.168.1.102] (76-216-240-245.lightspeed.irvnca.sbcglobal.net [76.216.240.245]) by xen.spamaps.org (Postfix) with ESMTP id 4F5A81600B9; Wed, 8 Dec 2010 11:12:58 -0800 (PST) To: Gustavo Lopes Cc: internals@lists.php.net In-Reply-To: References: <1291821030.7243.230.camel@clint-MacBookPro> Content-Type: text/plain; charset="UTF-8" Date: Wed, 08 Dec 2010 11:13:08 -0800 Message-ID: <1291835588.7243.273.camel@clint-MacBookPro> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RE : Re: [PHP-DEV] [PATCH] Add option to disable POST data processing From: clint@ubuntu.com (Clint Byrum) On Wed, 2010-12-08 at 18:49 +0000, Gustavo Lopes wrote: > On Wed, 08 Dec 2010 15:10:30 -0000, Clint Byrum wrote: > > > On Wed, 2010-12-08 at 01:11 +0000, Gustavo Lopes wrote: > >> > >> For instance, current scripts can, in POST requests, read any number of > >> times from php://input or $HTTP_RAW_POST_DATA (to simplify, let's say we > >> even let go $HTTP_RAW_POST_DATA). For this to be possible, you would > >> have to have the data in memory because you're reading from php://input > >> the > >> first time, you can't know if it will be read a second time, so you > >> either break BC or keep everything in memory just in case there's a > >> second read > >> -- and then you're where you started. > >> > > > > This example would be solved if during the lazy load you change the > > php://input stream to point at the memory location that you read it > > into. > > > > I'm sorry, this doesn't make any sense. "The memory location you read > into"? Who says you read the post data *into* something, much less a > memory location? > > Sorry, to be more clear: A lazy load on access to $_POST or $HTTP_RAW_POST_DATA would have to read the POST data from the SAPI. At that point, the SAPI can keep the buffer it allocates to read that data as a memory stream, and change its notion of php://input to refer to that stream.