pollita         Wed Jul 13 19:28:24 2005 EDT

  Modified files:              
    /php-src/ext/standard       ftp_fopen_wrapper.c 
  Log:
  Route ftp:// wrapper via transports layer.\nFix typo in datastream crypto 
startup
  
http://cvs.php.net/diff.php/php-src/ext/standard/ftp_fopen_wrapper.c?r1=1.82&r2=1.83&ty=u
Index: php-src/ext/standard/ftp_fopen_wrapper.c
diff -u php-src/ext/standard/ftp_fopen_wrapper.c:1.82 
php-src/ext/standard/ftp_fopen_wrapper.c:1.83
--- php-src/ext/standard/ftp_fopen_wrapper.c:1.82       Sat May  7 12:07:59 2005
+++ php-src/ext/standard/ftp_fopen_wrapper.c    Wed Jul 13 19:28:22 2005
@@ -18,7 +18,7 @@
    |          Sara Golemon <[EMAIL PROTECTED]>                              |
    +----------------------------------------------------------------------+
  */
-/* $Id: ftp_fopen_wrapper.c,v 1.82 2005/05/07 16:07:59 iliaa Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.83 2005/07/13 23:28:22 pollita Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -115,6 +115,8 @@
        int result, use_ssl, use_ssl_on_data = 0, tmp_len;
        char *scratch;
        char tmp_line[512];
+       char *transport;
+       int transport_len;
 
        resource = php_url_parse(path);
        if (resource == NULL || resource->path == NULL) {
@@ -130,7 +132,9 @@
        if (resource->port == 0)
                resource->port = 21;
        
-       stream = php_stream_sock_open_host(resource->host, resource->port, 
SOCK_STREAM, NULL, 0);
+       transport_len = spprintf(&transport, 0, "tcp://%s:%d", resource->host, 
resource->port);
+       stream = php_stream_xport_create(transport, transport_len, 
REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, NULL, 
NULL, NULL);
+       efree(transport);
        if (stream == NULL) {
                result = 0; /* silence */
                goto connect_errexit;
@@ -399,6 +403,8 @@
        zval **tmpzval;
        int allow_overwrite = 0;
        int read_write = 0;
+       char *transport;
+       int transport_len;
 
        tmp_line[0] = '\0';
 
@@ -535,7 +541,9 @@
        if (hoststart == NULL) {
                hoststart = resource->host;
        }
-       datastream = php_stream_sock_open_host(hoststart, portno, SOCK_STREAM, 
0, 0);
+       transport_len = spprintf(&transport, 0, "tcp://%s:%d", hoststart, 
portno);
+       datastream = php_stream_xport_create(transport, transport_len, 
REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, NULL, 
NULL, NULL);
+       efree(transport);
        if (datastream == NULL) {
                goto errexit;
        }
@@ -553,9 +561,9 @@
        php_stream_context_set(datastream, context);
        php_stream_notify_progress_init(context, 0, file_size);
 
-       if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream,
+       if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
                        STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 
||
-                       php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 
0)) {
+                       php_stream_xport_crypto_enable(datastream, 1 TSRMLS_CC) 
< 0)) {
 
                php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, 
"Unable to activate SSL mode");
                php_stream_close(datastream);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to