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()
273 php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", FG(from_address)); in php_ftp_fopen_connect()
275 php_stream_write_string(stream, "PASS anonymous\r\n"); in php_ftp_fopen_connect()
280 result = GET_FTP_RESULT(stream); in php_ftp_fopen_connect()
305 return stream; in php_ftp_fopen_connect()
312 if (stream) { in php_ftp_fopen_connect()
313 php_stream_close(stream); in php_ftp_fopen_connect()
322 static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phosts… in php_fopen_do_pasv() argument
331 php_stream_write_string(stream, "EPSV\r\n"); in php_fopen_do_pasv()
332 result = GET_FTP_RESULT(stream); in php_fopen_do_pasv()
338 php_stream_write_string(stream, "PASV\r\n"); in php_fopen_do_pasv()
339 result = GET_FTP_RESULT(stream); in php_fopen_do_pasv()
415 php_stream *stream = NULL, *datastream = NULL; in php_stream_url_wrap_ftp() local
464stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &reso… in php_stream_url_wrap_ftp()
465 if (!stream) { in php_stream_url_wrap_ftp()
470 php_stream_write_string(stream, "TYPE I\r\n"); in php_stream_url_wrap_ftp()
471 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
476 php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", resource->path); in php_stream_url_wrap_ftp()
479 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
505 php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path); in php_stream_url_wrap_ftp()
506 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
519 portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC); in php_stream_url_wrap_ftp()
532 php_stream_printf(stream TSRMLS_CC, "REST %ld\r\n", Z_LVAL_PP(tmpzval)); in php_stream_url_wrap_ftp()
533 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
549 …php_stream_printf(stream TSRMLS_CC, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->pat… in php_stream_url_wrap_ftp()
562 result = GET_FTP_RESULT(stream); in php_stream_url_wrap_ftp()
586 datastream->wrapperthis = stream; in php_stream_url_wrap_ftp()
595 if (stream) { in php_stream_url_wrap_ftp()
597 php_stream_close(stream); in php_stream_url_wrap_ftp()
607 static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) in php_ftp_dirstream_read() argument
615 innerstream = ((php_ftp_dirstream_data *)stream->abstract)->datastream; in php_ftp_dirstream_read()
658 static int php_ftp_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC) in php_ftp_dirstream_close() argument
660 php_ftp_dirstream_data *data = stream->abstract; in php_ftp_dirstream_close()
672 stream->abstract = NULL; in php_ftp_dirstream_close()
696 php_stream *stream, *reuseid, *datastream = NULL; in php_stream_ftp_opendir() local
706stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &reso… in php_stream_ftp_opendir()
707 if (!stream) { in php_stream_ftp_opendir()
712 php_stream_write_string(stream, "TYPE A\r\n"); in php_stream_ftp_opendir()
713 result = GET_FTP_RESULT(stream); in php_stream_ftp_opendir()
718 portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC); in php_stream_ftp_opendir()
724 …php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_opendir()
735 result = GET_FTP_RESULT(stream); in php_stream_ftp_opendir()
747 if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream, in php_stream_ftp_opendir()
749 php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0)) { in php_stream_ftp_opendir()
761 dirsdata->controlstream = stream; in php_stream_ftp_opendir()
770 if (stream) { in php_stream_ftp_opendir()
772 php_stream_close(stream); in php_stream_ftp_opendir()
785 php_stream *stream = NULL; in php_stream_ftp_url_stat() local
793stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL TS… in php_stream_ftp_url_stat()
794 if (!stream) { in php_stream_ftp_url_stat()
799 …php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/"))… in php_stream_ftp_url_stat()
800 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
807 …php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept… in php_stream_ftp_url_stat()
809 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
815 …php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_url_stat()
816 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
830 …php_stream_printf(stream TSRMLS_CC, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_url_stat()
831 result = GET_FTP_RESULT(stream); in php_stream_ftp_url_stat()
889 php_stream_close(stream); in php_stream_ftp_url_stat()
897 if (stream) { in php_stream_ftp_url_stat()
898 php_stream_close(stream); in php_stream_ftp_url_stat()
908 php_stream *stream = NULL; in php_stream_ftp_unlink() local
913stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRML… in php_stream_ftp_unlink()
914 if (!stream) { in php_stream_ftp_unlink()
929 …php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/")… in php_stream_ftp_unlink()
931 result = GET_FTP_RESULT(stream); in php_stream_ftp_unlink()
940 php_stream_close(stream); in php_stream_ftp_unlink()
947 if (stream) { in php_stream_ftp_unlink()
948 php_stream_close(stream); in php_stream_ftp_unlink()
958 php_stream *stream = NULL; in php_stream_ftp_rename() local
984stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL TSRML… in php_stream_ftp_rename()
985 if (!stream) { in php_stream_ftp_rename()
993 …php_stream_printf(stream TSRMLS_CC, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->p… in php_stream_ftp_rename()
995 result = GET_FTP_RESULT(stream); in php_stream_ftp_rename()
1004 …php_stream_printf(stream TSRMLS_CC, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path … in php_stream_ftp_rename()
1006 result = GET_FTP_RESULT(stream); in php_stream_ftp_rename()
1016 php_stream_close(stream); in php_stream_ftp_rename()
1026 if (stream) { in php_stream_ftp_rename()
1027 php_stream_close(stream); in php_stream_ftp_rename()
1037 php_stream *stream = NULL; in php_stream_ftp_mkdir() local
1042stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRML… in php_stream_ftp_mkdir()
1043 if (!stream) { in php_stream_ftp_mkdir()
1058 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path); in php_stream_ftp_mkdir()
1059 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1070 php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", buf); in php_stream_ftp_mkdir()
1071 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1078 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path); in php_stream_ftp_mkdir()
1079 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1081 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf); in php_stream_ftp_mkdir()
1082 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1091 php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf); in php_stream_ftp_mkdir()
1092 result = GET_FTP_RESULT(stream); in php_stream_ftp_mkdir()
1107 php_stream_close(stream); in php_stream_ftp_mkdir()
1120 if (stream) { in php_stream_ftp_mkdir()
1121 php_stream_close(stream); in php_stream_ftp_mkdir()
1131 php_stream *stream = NULL; in php_stream_ftp_rmdir() local
1136stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRML… in php_stream_ftp_rmdir()
1137 if (!stream) { in php_stream_ftp_rmdir()
1151 php_stream_printf(stream TSRMLS_CC, "RMD %s\r\n", resource->path); in php_stream_ftp_rmdir()
1152 result = GET_FTP_RESULT(stream); in php_stream_ftp_rmdir()
1162 php_stream_close(stream); in php_stream_ftp_rmdir()
1170 if (stream) { in php_stream_ftp_rmdir()
1171 php_stream_close(stream); in php_stream_ftp_rmdir()