Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46963 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69986 invoked from network); 9 Feb 2010 00:18:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2010 00:18:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.172 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.210.172 mail-yx0-f172.google.com Received: from [209.85.210.172] ([209.85.210.172:61999] helo=mail-yx0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/E2-49338-BE9A07B4 for ; Mon, 08 Feb 2010 19:18:52 -0500 Received: by yxe2 with SMTP id 2so6015725yxe.7 for ; Mon, 08 Feb 2010 16:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=e0+KhM/m/moWziOt1zbJ2Rx04SN96PjNupakLSalk/c=; b=EhKvQKopUlxGsRlIzoO9+AwdhSkAN4SDZxIvt85J7Qga8Nvru1ofhjB0dflG1rSPg6 XNCdoRHtfwa0auOWMpmyjF1XD9YTtEWFSsLbV+Dl5YaZP889x6BqZIVxqqxIwSgYD3bC 8a9HeVw/6Sy6MzZkYJMD4Zv2BQ4K5jT5FCXdQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=q/S1VO4MImIDsSrHqYwqr5zcMXr0zCFI+ogdRXtvpGLww6oK91mQq/+PEonDzXFKtu 6qSk7/FdM/ZN2ZaAsjlf82dFqGZkP8a6KwT01InOq0LtjZdopchnhH/DtahAyn3xAsDH 9s83rUF8U+6VT/6epJ5I5h9+8riaaxcabquaw= MIME-Version: 1.0 Received: by 10.101.7.23 with SMTP id k23mr9441028ani.36.1265674729480; Mon, 08 Feb 2010 16:18:49 -0800 (PST) In-Reply-To: <679B196B-E276-44BE-87EB-6949A673A205@meteonews.ch> References: <679B196B-E276-44BE-87EB-6949A673A205@meteonews.ch> Date: Tue, 9 Feb 2010 01:18:49 +0100 Message-ID: To: Beat Vontobel Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [PATCH] Fix for bug #48607 (ftp_fopen_wrapper) From: pierre.php@gmail.com (Pierre Joye) hi, On Mon, Feb 8, 2010 at 12:03 PM, Beat Vontobel wrote: > I'm new to the PHP internals mailing list (and also to PHP internals in > general), so let's first say hello to everybody and thanks for your work! Thanks and welcome to the list :) > I needed to dive into PHP's internals myself because I hit a problem (which > I later found to be bug #48607) with the ftp_fopen_wrapper: fwrite basically > doesn't work at all with FTP, because PHP's implementation is in violation > of the FTP specs. No EOF is signalled at the end of a transmission -- PHP's > behaviour after writing to an FTP server has to be treated as an aborted > connection by a clean server. If an fwrite to an FTP server ever succeeded, > it was only due to lucky timing coincidence or buggy servers. > > The patch below fixes this issue for me. I run it successfully since more > than a month on two high-load production webservers. I'd be happy if > somebody more familiar with PHP's internals could review it, apply it to SVN > and then hopefully close bug #48607. Do you have tests cases please? Also specify which server you use so we can run the tests in the similar context, or compare with alternative ftp servers if necessary. > Just one important note for the reviewer: I wasn't quite sure on how to > correctly "hand up" errors to the higher levels of the API. That's where I > just used php_error_docref(), which is probably not the intended way, but > worked for me to at least generate a warning. I also now set the return > value of the function on failure, but realized that it's again hardcoded to > "success" on higher levels of the code. This would probably make for another > bug report and more patches. It would be cleaner to fix them as well then no? Can you give it a try? Thanks for your work! Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org