Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68991 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55356 invoked from network); 10 Sep 2013 11:29:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2013 11:29:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.180 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.217.180 mail-lb0-f180.google.com Received: from [209.85.217.180] ([209.85.217.180:56856] helo=mail-lb0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/46-03199-6820F225 for ; Tue, 10 Sep 2013 07:29:11 -0400 Received: by mail-lb0-f180.google.com with SMTP id q8so6146956lbi.11 for ; Tue, 10 Sep 2013 04:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZM3H7vzt1v9GWsJI4TswvEaBgv10zjJL2yflHdLCzYc=; b=nCkUAZgHh27kQLDnIZxS4XD3XTLQqSPAKSgg43/4l8p8wsTb1pkcNVoYr92RDv38wW 7uxTbrEciZEmw3pUhSwI1vSeUTyyOsJOBA690lptARPKzOhDcfXSmRZuijGNq4XNr5rN LidTJwl+D7j0bVjfP0u+mTAvO+mgTOIiI6kEFAcTjDUt0Lxg63X02jdNbFH/gpg00JSd HjmYucGzswLsBfVP+MMCWlcD45QBnmd6W3GqGzkNAZ3/GFt0V/fATG4QTolEm98rbcUG nVaiy7NdYzXKNGhE2tuHmnm6jgm6+cUqNIEAyzLeJslXJknhcB3VnqxMxz8iLrkTxc1/ RdsQ== MIME-Version: 1.0 X-Received: by 10.112.128.166 with SMTP id np6mr20800841lbb.7.1378812548222; Tue, 10 Sep 2013 04:29:08 -0700 (PDT) Sender: mike.php.net@gmail.com Received: by 10.114.184.19 with HTTP; Tue, 10 Sep 2013 04:29:08 -0700 (PDT) In-Reply-To: References: <521D174D.4030802@nebm.ist.utl.pt> Date: Tue, 10 Sep 2013 13:29:08 +0200 X-Google-Sender-Auth: YyqYvs4VrBvobFNLaXEUj7rLifE Message-ID: To: Gustavo Lopes Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] PROPOSAL: temp stream for post_data From: mike@php.net (Michael Wallner) On 28 August 2013 08:14, Michael Wallner wrote: > Hi Gustavo, thank you for your review! > > On 27 August 2013 23:17, Gustavo Lopes wrote: >> I think it's generally a good idea, but I have some concerns: >> >> * The whole point of PG(enable_post_data_reading) is to be able to read the >> input of the fly. If I read your patch correctly, the data is completely >> gobbled when you open php://input and then the temp file is reminded. This >> will result in a serious performance degradation on large inputs, as >> processing can only start after everything has been read. The behavior >> should be different if PG(enable_post_data_reading) is false. > > Ok, *I* thought the whole point of enable_post_data_reading is not to > swamp your memory :) We can have that behaviour of course, but then > the input stream is not reusable. ... >> * The php://input streams simply forward the calls to >> SG(request_info).request_body, so if you open two, the per-stream cursor >> position may not match the position of the wrapped stream (even if it >> matched, we wouldn't want one stream to affect the position of the other). I > > True! So my input stream handles concurrency as bad as the current > implementation... 8) > >> don't see any easy way out here; all I can think of is is duping the file >> descriptor for the temporary file in these situations. But then the book >> keeping for php://input would be more complicated. > > I think that shouldn't be too hard to fix. But it depends on concern no.1 :) Fixed. The input stream is reusable *and* may be used JIT. https://github.com/m6w6/php-src/compare/slim-postdata-merge -- Regards, Mike