1 --- PHP_5_3/ext/standard/ftp_fopen_wrapper.c 2010/12/13 14:29:42 306341
2 +++ PHP_5_3/ext/standard/ftp_fopen_wrapper.c 2010/12/13 16:53:26 306342
4 static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC)
6 php_stream *controlstream = (php_stream *)stream->wrapperdata;
10 + if (strpbrk(stream->mode, "wa+")) {
14 + /* For write modes close data stream first to signal EOF to server */
15 + stream->wrapperdata = NULL;
16 + php_stream_close(stream);
19 + result = GET_FTP_RESULT(controlstream);
20 + if (result != 226 && result != 250) {
21 + php_error_docref(NULL TSRMLS_CC, E_WARNING, "FTP server error %d:%s", result, tmp_line);
26 php_stream_write_string(controlstream, "QUIT\r\n");
27 php_stream_close(controlstream);
28 - stream->wrapperdata = NULL;
30 + stream->wrapperdata = NULL;