Lines Matching refs:stream

73 #define GET_FTP_RESULT(stream)	get_ftp_result((stream), tmp_line, sizeof(tmp_line) TSRMLS_CC)  argument
83 static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC) in get_ftp_result() argument
85 while (php_stream_gets(stream, buffer, buffer_size-1) && in get_ftp_result()
94 static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_s… in php_stream_ftp_stream_stat() argument
104 static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC) in php_stream_ftp_stream_close()
106 php_stream *controlstream = stream->wrapperthis; in php_stream_ftp_stream_close()
110 if (strpbrk(stream->mode, "wa+")) { in php_stream_ftp_stream_close()
124 stream->wrapperthis = NULL; in php_stream_ftp_stream_close()
136 php_stream *stream = NULL, *reuseid = NULL; in php_ftp_fopen_connect() local
158stream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | ST… in php_ftp_fopen_connect()
160 if (stream == NULL) { in php_ftp_fopen_connect()
165 php_stream_context_set(stream, context); in php_ftp_fopen_connect()
169 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
178 php_stream_write_string(stream, "AUTH TLS\r\n"); in php_ftp_fopen_connect()
181 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
184 php_stream_write_string(stream, "AUTH SSL\r\n"); in php_ftp_fopen_connect()
187 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
193 reuseid = stream; in php_ftp_fopen_connect()
204 if (php_stream_xport_crypto_setup(stream, in php_ftp_fopen_connect()
206 || php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) { in php_ftp_fopen_connect()
208 php_stream_close(stream); in php_ftp_fopen_connect()
209 stream = NULL; in php_ftp_fopen_connect()
214 php_stream_write_string(stream, "PBSZ 0\r\n"); in php_ftp_fopen_connect()
217 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
221 php_stream_write_string(stream, "PROT P\r\n"); in php_ftp_fopen_connect()
224 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
227 php_stream_write_string(stream, "PROT C\r\n"); in php_ftp_fopen_connect()
230 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
251 php_stream_printf(stream TSRMLS_CC, "USER %s\r\n", resource->user); in php_ftp_fopen_connect()
253 php_stream_write_string(stream, "USER anonymous\r\n"); in php_ftp_fopen_connect()
257 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
268 php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", resource->pass); in php_ftp_fopen_connect()
274 php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", from_address); in php_ftp_fopen_connect()
276 php_stream_write_string(stream, "PASS anonymous\r\n"); in php_ftp_fopen_connect()
281 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
306 return stream; in php_ftp_fopen_connect()
313 if (stream) { in php_ftp_fopen_connect()
314 php_stream_close(stream); in php_ftp_fopen_connect()
323 static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phosts… in php_fopen_do_pasv() argument
332 php_stream_write_string(stream, "EPSV\r\n"); in php_fopen_do_pasv()
333 result = GET_FTP_RESULT(stream); in php_fopen_do_pasv()
339 php_stream_write_string(stream, "PASV\r\n"); in php_fopen_do_pasv()
340 result = GET_FTP_RESULT(stream); in php_fopen_do_pasv()
416 php_stream *stream = NULL, *datastream = NULL; in php_stream_url_wrap_ftp() local
465stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &reso… in php_stream_url_wrap_ftp()
466 if (!stream) { in php_stream_url_wrap_ftp()
471 php_stream_write_string(stream, "TYPE I\r\n"); in php_stream_url_wrap_ftp()
472 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
477 php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", resource->path); in php_stream_url_wrap_ftp()
480 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
506 php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path); in php_stream_url_wrap_ftp()
507 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
520 portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC); in php_stream_url_wrap_ftp()
533 php_stream_printf(stream TSRMLS_CC, "REST %ld\r\n", Z_LVAL_PP(tmpzval)); in php_stream_url_wrap_ftp()
534 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
550 …php_stream_printf(stream TSRMLS_CC, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->pat… in php_stream_url_wrap_ftp()
563 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
587 datastream->wrapperthis = stream; in php_stream_url_wrap_ftp()
596 if (stream) { in php_stream_url_wrap_ftp()
598 php_stream_close(stream); in php_stream_url_wrap_ftp()
608 static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) in php_ftp_dirstream_read() argument
616 innerstream = ((php_ftp_dirstream_data *)stream->abstract)->datastream; in php_ftp_dirstream_read()
659 static int php_ftp_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC) in php_ftp_dirstream_close() argument
661 php_ftp_dirstream_data *data = stream->abstract; in php_ftp_dirstream_close()
673 stream->abstract = NULL; in php_ftp_dirstream_close()
697 php_stream *stream, *reuseid, *datastream = NULL; in php_stream_ftp_opendir() local
707stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &reso… in php_stream_ftp_opendir()
708 if (!stream) { in php_stream_ftp_opendir()
713 php_stream_write_string(stream, "TYPE A\r\n"); in php_stream_ftp_opendir()
714 result = GET_FTP_RESULT(stream); in php_stream_ftp_opendir()
719 portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC); in php_stream_ftp_opendir()
725 …php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_opendir()
736 result = GET_FTP_RESULT(stream); in php_stream_ftp_opendir()
748 if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream, in php_stream_ftp_opendir()
750 php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0)) { in php_stream_ftp_opendir()
762 dirsdata->controlstream = stream; in php_stream_ftp_opendir()
771 if (stream) { in php_stream_ftp_opendir()
773 php_stream_close(stream); in php_stream_ftp_opendir()
786 php_stream *stream = NULL; in php_stream_ftp_url_stat() local
794stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL TS… in php_stream_ftp_url_stat()
795 if (!stream) { in php_stream_ftp_url_stat()
800 …php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/"))… in php_stream_ftp_url_stat()
801 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
808 …php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept… in php_stream_ftp_url_stat()
810 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
816 …php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_url_stat()
817 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
831 …php_stream_printf(stream TSRMLS_CC, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_url_stat()
832 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
890 php_stream_close(stream); in php_stream_ftp_url_stat()
898 if (stream) { in php_stream_ftp_url_stat()
899 php_stream_close(stream); in php_stream_ftp_url_stat()
909 php_stream *stream = NULL; in php_stream_ftp_unlink() local
914stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRML… in php_stream_ftp_unlink()
915 if (!stream) { in php_stream_ftp_unlink()
930 …php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_unlink()
932 result = GET_FTP_RESULT(stream); in php_stream_ftp_unlink()
941 php_stream_close(stream); in php_stream_ftp_unlink()
948 if (stream) { in php_stream_ftp_unlink()
949 php_stream_close(stream); in php_stream_ftp_unlink()
959 php_stream *stream = NULL; in php_stream_ftp_rename() local
985stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL TSRML… in php_stream_ftp_rename()
986 if (!stream) { in php_stream_ftp_rename()
994 …php_stream_printf(stream TSRMLS_CC, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->p… in php_stream_ftp_rename()
996 result = GET_FTP_RESULT(stream); in php_stream_ftp_rename()
1005 …php_stream_printf(stream TSRMLS_CC, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path … in php_stream_ftp_rename()
1007 result = GET_FTP_RESULT(stream); in php_stream_ftp_rename()
1017 php_stream_close(stream); in php_stream_ftp_rename()
1027 if (stream) { in php_stream_ftp_rename()
1028 php_stream_close(stream); in php_stream_ftp_rename()
1038 php_stream *stream = NULL; in php_stream_ftp_mkdir() local
1043stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRML… in php_stream_ftp_mkdir()
1044 if (!stream) { in php_stream_ftp_mkdir()
1059 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path); in php_stream_ftp_mkdir()
1060 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1071 php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", buf); in php_stream_ftp_mkdir()
1072 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1079 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path); in php_stream_ftp_mkdir()
1080 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1082 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf); in php_stream_ftp_mkdir()
1083 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1092 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf); in php_stream_ftp_mkdir()
1093 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1108 php_stream_close(stream); in php_stream_ftp_mkdir()
1121 if (stream) { in php_stream_ftp_mkdir()
1122 php_stream_close(stream); in php_stream_ftp_mkdir()
1132 php_stream *stream = NULL; in php_stream_ftp_rmdir() local
1137stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRML… in php_stream_ftp_rmdir()
1138 if (!stream) { in php_stream_ftp_rmdir()
1152 php_stream_printf(stream TSRMLS_CC, "RMD %s\r\n", resource->path); in php_stream_ftp_rmdir()
1153 result = GET_FTP_RESULT(stream); in php_stream_ftp_rmdir()
1163 php_stream_close(stream); in php_stream_ftp_rmdir()
1171 if (stream) { in php_stream_ftp_rmdir()
1172 php_stream_close(stream); in php_stream_ftp_rmdir()