1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00

MFB52: ws+cs

This commit is contained in:
Jani Taskinen
2007-09-27 13:15:40 +00:00
parent 10150ea755
commit bea9591f47
+21 -19
View File
@@ -69,7 +69,11 @@
#include "php_fopen_wrappers.h"
#define FTPS_ENCRYPT_DATA 1
#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line) TSRMLS_CC)
/* {{{ get_ftp_result
*/
static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC)
{
while (php_stream_gets(stream, buffer, buffer_size-1) &&
@@ -77,24 +81,21 @@ static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer
isdigit((int) buffer[2]) && buffer[3] == ' '));
return strtol(buffer, NULL, 10);
}
#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line) TSRMLS_CC)
/* }}} */
#define FTPS_ENCRYPT_DATA 1
static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper,
php_stream *stream,
php_stream_statbuf *ssb
TSRMLS_DC)
/* {{{ php_stream_ftp_stream_stat
*/
static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
{
/* For now, we return with a failure code to prevent the underlying
* file's details from being used instead. */
return -1;
}
/* }}} */
static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper,
php_stream *stream
TSRMLS_DC)
/* {{{ php_stream_ftp_stream_close
*/
static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC)
{
php_stream *controlstream = (php_stream *)stream->wrapperdata;
@@ -105,6 +106,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper,
}
return 0;
}
/* }}} */
/* {{{ php_ftp_fopen_connect
*/
@@ -564,7 +566,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
php_url_free(resource);
return datastream;
errexit:
errexit:
if (resource) {
php_url_free(resource);
}
@@ -728,7 +730,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, char *path, cha
php_url_free(resource);
return php_stream_alloc(&php_ftp_dirstream_ops, datastream, 0, mode);
opendir_errexit:
opendir_errexit:
if (resource) {
php_url_free(resource);
}
@@ -828,7 +830,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
#endif
} else {
/* error or unsupported command */
mdtm_error:
mdtm_error:
#ifdef NETWARE
ssb->sb.st_mtime.tv_sec = -1;
#else
@@ -860,7 +862,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
php_url_free(resource);
return 0;
stat_errexit:
stat_errexit:
if (resource) {
php_url_free(resource);
}
@@ -910,7 +912,7 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, char *url, int opt
php_stream_close(stream);
return 1;
unlink_errexit:
unlink_errexit:
if (resource) {
php_url_free(resource);
}
@@ -986,7 +988,7 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, char *url_from, ch
php_stream_close(stream);
return 1;
rename_errexit:
rename_errexit:
if (resource_from) {
php_url_free(resource_from);
}
@@ -1083,7 +1085,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, char *url, int mode
return 1;
mkdir_errexit:
mkdir_errexit:
if (resource) {
php_url_free(resource);
}
@@ -1133,7 +1135,7 @@ static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, char *url, int opti
return 1;
rmdir_errexit:
rmdir_errexit:
if (resource) {
php_url_free(resource);
}