Re: RE : Re: [PHP-DEV] [PATCH] Add option to disable POST data processing
| From: | Clint Byrum | Date: | Wed, 08 Dec 2010 19:13:08 +0000 |
| Subject: | Re: RE : Re: [PHP-DEV] [PATCH] Add option to disable POST data processing | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50914@lists.php.net to get a copy of this message | ||
On Wed, 2010-12-08 at 18:49 +0000, Gustavo Lopes wrote:
> On Wed, 08 Dec 2010 15:10:30 -0000, Clint Byrum <clint@ubuntu.com> 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.