pajoye                                   Wed, 03 Feb 2010 20:53:31 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=294464

Log:
- Fixed bug #50756 (CURLOPT_FTP_SKIP_PASV_IP does not exist.)

Bug: http://bugs.php.net/50756 (To be documented) CURLOPT_FTP_SKIP_PASV_IP does 
not exist
      
Changed paths:
    _U  php/php-src/branches/PHP_5_3_2/
    U   php/php-src/branches/PHP_5_3_2/ext/curl/interface.c
    A + php/php-src/branches/PHP_5_3_2/ext/curl/tests/curl_ftp_pasv.phpt
        (from 
php/php-src/branches/PHP_5_3/ext/curl/tests/curl_ftp_pasv.phpt:r293862)
    _U  php/php-src/branches/PHP_5_3_2/ext/tidy/tests/
    _U  
php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt


Property changes on: php/php-src/branches/PHP_5_3_2
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293974
/php/php-src/trunk:284726
   + 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293862,293974
/php/php-src/trunk:284726

Modified: php/php-src/branches/PHP_5_3_2/ext/curl/interface.c
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/curl/interface.c 2010-02-03 20:50:38 UTC 
(rev 294463)
+++ php/php-src/branches/PHP_5_3_2/ext/curl/interface.c 2010-02-03 20:53:31 UTC 
(rev 294464)
@@ -789,6 +789,7 @@

 #if LIBCURL_VERSION_NUM >= 0x070f01
        REGISTER_CURL_CONSTANT(CURLOPT_FTP_FILEMETHOD);
+       REGISTER_CURL_CONSTANT(CURLOPT_FTP_SKIP_PASV_IP);
 #endif

 #if LIBCURL_VERSION_NUM >= 0x071001
@@ -1657,6 +1658,7 @@
 #endif
 #if LIBCURL_VERSION_NUM >= 0x070f01
                case CURLOPT_FTP_FILEMETHOD:
+               case CURLOPT_FTP_SKIP_PASV_IP:
 #endif
 #if LIBCURL_VERSION_NUM >  0x071301
                case CURLOPT_CERTINFO:

Copied: php/php-src/branches/PHP_5_3_2/ext/curl/tests/curl_ftp_pasv.phpt (from 
rev 293862, php/php-src/branches/PHP_5_3/ext/curl/tests/curl_ftp_pasv.phpt)
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/curl/tests/curl_ftp_pasv.phpt            
                (rev 0)
+++ php/php-src/branches/PHP_5_3_2/ext/curl/tests/curl_ftp_pasv.phpt    
2010-02-03 20:53:31 UTC (rev 294464)
@@ -0,0 +1,59 @@
+--TEST--
+Test curl_exec() function with basic functionality
+--CREDITS--
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_FTP_REMOTE_SERVER'))  exit("skip 
PHP_CURL_FTP_REMOTE_SERVER env variable is not defined");
+if (false === getenv('PHP_CURL_FTP_REMOTE_USER'))  exit("skip 
PHP_CURL_FTP_REMOTE_USER env variable is not defined");
+if (false === getenv('PHP_CURL_FTP_REMOTE_PASSWD'))  exit("skip 
PHP_CURL_FTP_REMOTE_PASSWD env variable is not defined");
+?>
+--FILE--
+<?php
+  $host = getenv('PHP_CURL_FTP_REMOTE_SERVER');
+  $username = getenv('PHP_CURL_FTP_REMOTE_USER');
+  $password = getenv('PHP_CURL_FTP_REMOTE_PASSWD');
+
+  // FTP this script to a server
+  $fp  =  fopen ( __FILE__ ,  "r" );
+  $url  =  "ftp://$username:$passw...@$host/test.phpt"; ;
+
+  $ch  =  curl_init ();
+
+  // enable below to get the output in verbose mode.
+  // curl_setopt ( $ch , CURLOPT_VERBOSE, 1 );
+
+  /* Without enabling SKIP_PASV_IP flag, the following output will be seen..
+       < 227 Entering Passive Mode (10,5,80,146,100,199)
+       *   Trying 10.5.80.146... * connected
+       * Connecting to 10.5.80.146 (10.5.80.146) port 25799
+   */
+
+  /* After enabling SKIP_PASV_IP flag, the following output will be seen..
+       < 227 Entering Passive Mode (10,5,80,146,50,229)
+       * Skips 10.5.80.146 for data connection, uses 10.5.80.146 instead
+       *   Trying 10.5.80.146... * connected
+   */
+
+  curl_setopt ( $ch , CURLOPT_URL, $url );
+  curl_setopt ( $ch , CURLOPT_TRANSFERTEXT, 1 );
+
+  //force passive connection
+  curl_setopt ( $ch , CURLOPT_FTP_USE_EPSV, 0 );
+  curl_setopt ( $ch , CURLOPT_FTP_SKIP_PASV_IP, 1 );
+
+  // mark the file for upload..
+  curl_setopt ( $ch , CURLOPT_INFILE, $fp );
+  curl_setopt ( $ch , CURLOPT_INFILESIZE,  filesize(__FILE__) );
+  curl_setopt ( $ch , CURLOPT_PUT, 1 );
+  curl_setopt ( $ch , CURLOPT_UPLOAD, 1 );
+
+  $result  =  curl_exec ( $ch );
+  var_dump ( $result );
+  curl_close ( $ch );
+
+?>
+===DONE===
+--EXPECTF--
+bool(true)
+===DONE===


Property changes on: php/php-src/branches/PHP_5_3_2/ext/tidy/tests
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941
   + 
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293862
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941


Property changes on: 
php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951
   + 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293862
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951

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

Reply via email to