ID: 48607 Updated by: sjo...@php.net Reported By: karachi at mail dot ru Status: Verified Bug Type: Streams related Operating System: FreeBSD PHP Version: 5.2.10 New Comment:
The solution may be something like this, although this may break things when the current transaction is not about to send a 226 Transfer complete. Index: ext/standard/ftp_fopen_wrapper.c =================================================================== --- ext/standard/ftp_fopen_wrapper.c (revision 287652) +++ ext/standard/ftp_fopen_wrapper.c (working copy) @@ -97,7 +97,16 @@ */ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC) { + int result; + char tmp_line[512]; + php_stream *controlstream = (php_stream *)stream->wrapperdata; + + result = GET_FTP_RESULT(controlstream); + if (result != 226 && result != 250) { + // Maybe throw a warning? + return 1; + } if (controlstream) { php_stream_write_string(controlstream, "QUIT\r\n"); Previous Comments: ------------------------------------------------------------------------ [2009-08-25 16:33:02] sjo...@php.net I could reproduce the QUIT before the transfer being complete. FTP Request: STOR /a.php FTP Response: 150 Opening BINARY mode data connection for /a.php FTP Request: QUIT FTP Response: 226 Transfer complete ------------------------------------------------------------------------ [2009-08-25 08:28:23] sjo...@php.net You can use a pastebin or e-mail it to sjoerd-php at linuxonly dot nl. ------------------------------------------------------------------------ [2009-08-18 16:24:58] karachi at mail dot ru I mean I captured data but I can't attach them to the bug ------------------------------------------------------------------------ [2009-08-18 16:23:58] karachi at mail dot ru Where can I save captured ftp data? ------------------------------------------------------------------------ [2009-08-13 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/48607 -- Edit this bug report at http://bugs.php.net/?id=48607&edit=1