5).
Changelog
+Daniel (19 February 2007)
+- Robson Braga Araujo made passive FTP transfers work with SOCKS (both 4 and
+ 5).
+
Daniel (18 February 2007)
- Jeff Pohlmeyer identified two problems: first a rather obscure problem with
the multi interface and connection re-use that could make a
o builds fine with VC2005
o CURLOPT_RANGE set to NULL resets the range for FTP
o curl_multi_remove_handle() rare crash
+ o passive FTP transfers work with SOCKS
This release includes the following known bugs:
advice from friends like these:
Yang Tse, Manfred Schwarb, Michael Wallner, Jeff Pohlmeyer, Shmulik Regev,
- Rob Crittenden, Robert A. Monat, Dan Fandrich, Duncan Mac-Vicar Prett,
- Michal Marek
+ Rob Crittenden, Robert A. Monat, Dan Fandrich, Duncan Mac-Vicar Prett,
+ Michal Marek, Robson Braga Araujo
Thanks! (and sorry if I forgot to mention someone)
"system context" will make it use wrong(?) user name - at least when compared
to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=1281867
-23. We don't support SOCKS for IPv6. We don't support FTPS over a SOCKS proxy.
- We don't have any test cases for SOCKS proxy. We probably have even more
- bugs and lack of features when a SOCKS proxy is used. And there seem to be a
- problem with SOCKS when doing FTP: See
- http://curl.haxx.se/bug/view.cgi?id=1371540
+23. SOCKS-related problems:
+ A) libcurl doesn't support SOCKS for IPv6.
+ B) libcurl doesn't support FTPS over a SOCKS proxy.
+ C) We don't have any test cases for SOCKS proxy.
+ E) libcurl doesn't support active FTP over a SOCKS proxy
+
+ We probably have even more bugs and lack of features when a SOCKS proxy is
+ used.
22. Sending files to a FTP server using curl on VMS, might lead to curl
complaining on "unaligned file size" on completion. The problem is related
/* this just dumps information about this second connection */
ftp_pasv_verbose(conn, conninfo, newhost, connectport);
+ switch(data->set.proxytype) {
+ case CURLPROXY_SOCKS5:
+ result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, newhost, newport,
+ SECONDARYSOCKET, conn);
+ break;
+ case CURLPROXY_HTTP:
+ /* do nothing here. handled later. */
+ break;
+ case CURLPROXY_SOCKS4:
+ result = Curl_SOCKS4(conn->proxyuser, newhost, newport,
+ SECONDARYSOCKET, conn);
+ break;
+ default:
+ failf(data, "unknown proxytype option given");
+ result = CURLE_COULDNT_CONNECT;
+ break;
+ }
#ifndef CURL_DISABLE_HTTP
if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
/* FIX: this MUST wait for a proper connect first if 'connected' is
* Nonsupport "Identification Protocol (RFC1413)"
*/
CURLcode Curl_SOCKS4(const char *proxy_name,
+ char *hostname,
+ int remote_port,
+ int sockindex,
struct connectdata *conn)
{
unsigned char socksreq[262]; /* room for SOCKS4 request incl. user id */
int result;
CURLcode code;
- curl_socket_t sock = conn->sock[FIRSTSOCKET];
+ curl_socket_t sock = conn->sock[sockindex];
long timeout;
struct SessionHandle *data = conn->data;
socksreq[0] = 4; /* version (SOCKS4) */
socksreq[1] = 1; /* connect */
- *((unsigned short*)&socksreq[2]) = htons(conn->remote_port);
+ *((unsigned short*)&socksreq[2]) = htons(remote_port);
/* DNS resolve */
{
Curl_addrinfo *hp=NULL;
int rc;
- rc = Curl_resolv(conn, conn->host.name, (int)conn->remote_port, &dns);
+ rc = Curl_resolv(conn, hostname, remote_port, &dns);
if(rc == CURLRESOLV_ERROR)
return CURLE_COULDNT_RESOLVE_PROXY;
}
if(!hp) {
failf(data, "Failed to resolve \"%s\" for SOCKS4 connect.",
- conn->host.name);
+ hostname);
return CURLE_COULDNT_RESOLVE_HOST;
}
}
*/
CURLcode Curl_SOCKS5(const char *proxy_name,
const char *proxy_password,
+ char *hostname,
+ int remote_port,
+ int sockindex,
struct connectdata *conn)
{
/*
ssize_t written;
int result;
CURLcode code;
- curl_socket_t sock = conn->sock[FIRSTSOCKET];
+ curl_socket_t sock = conn->sock[sockindex];
struct SessionHandle *data = conn->data;
long timeout;
{
struct Curl_dns_entry *dns;
Curl_addrinfo *hp=NULL;
- int rc = Curl_resolv(conn, conn->host.name, (int)conn->remote_port, &dns);
+ int rc = Curl_resolv(conn, hostname, remote_port, &dns);
if(rc == CURLRESOLV_ERROR)
return CURLE_COULDNT_RESOLVE_HOST;
}
if(!hp) {
failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.",
- conn->host.name);
+ hostname);
return CURLE_COULDNT_RESOLVE_HOST;
}
}
- *((unsigned short*)&socksreq[8]) = htons(conn->remote_port);
+ *((unsigned short*)&socksreq[8]) = htons(remote_port);
{
const int packetsize = 10;
* final destination server.
*/
CURLcode Curl_SOCKS4(const char *proxy_name,
+ char *hostname,
+ int remote_port,
+ int sockindex,
struct connectdata *conn);
/*
*/
CURLcode Curl_SOCKS5(const char *proxy_name,
const char *proxy_password,
+ char *hostname,
+ int remote_port,
+ int sockindex,
struct connectdata *conn);
#endif
switch(data->set.proxytype) {
case CURLPROXY_SOCKS5:
- result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn);
+ result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn->host.name,
+ conn->remote_port, FIRSTSOCKET, conn);
break;
case CURLPROXY_HTTP:
/* do nothing here. handled later. */
break;
case CURLPROXY_SOCKS4:
- result = Curl_SOCKS4(conn->proxyuser, conn);
+ result = Curl_SOCKS4(conn->proxyuser, conn->host.name, conn->remote_port,
+ FIRSTSOCKET, conn);
break;
default:
failf(data, "unknown proxytype option given");