cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: There is one bug for FTP over SOCKS4/5 proxy

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 28 Jun 2007 13:01:22 +0200 (CEST)

On Thu, 28 Jun 2007, Song Ma wrote:

> With the cURL's latest source code user still can not do FTP download via
> SOCKS4/5 proxy server, when the proxy server is different from FTP server
> (This is the most case) with command like "curl -v ftp://ftp_server --socks5
> socks_server -u user:passwd". Test case is successful just because
> "ftp_server" and "socks_server" is occasionally the same (127.0.0.1) for
> test environment.

Are you saying that the fix is something like this?

--- lib/ftp.c 24 Jun 2007 19:32:33 -0000 1.416
+++ lib/ftp.c 28 Jun 2007 10:58:47 -0000
@@ -1662,7 +1662,9 @@
         infof(data, "Skips %d.%d.%d.%d for data connection, uses %s instead\n",
               ip[0], ip[1], ip[2], ip[3],
               conn->ip_addr_str);
- if (conn->bits.tunnel_proxy)
+ if (conn->bits.tunnel_proxy ||
+ (data->set.proxytype == CURLPROXY_SOCKS4) ||
+ (data->set.proxytype == CURLPROXY_SOCKS5))
           /* proxy tunnel -> use other host info because ip_addr_str is the
              proxy address not the ftp host */
           snprintf(newhost, sizeof(newhost), "%s", conn->host.name);

-- 
   Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-06-28