cURL / Mailing Lists / curl-library / Single Mail

curl-library

FTP over HTTP Proxy with CONNECT

From: Mike Jean <mikej06_at_hotmail.com>
Date: Fri, 06 Jan 2006 17:13:48 +0000

Hey,

first, libcurl is a very nice library.
Now the problem.
perhaps I made something wrong, but it can also be a bug within libcurl.

I tried a download via passiv ftp over a http proxy. I am using the CONNECT
feature of
the http proxy.

The first problem occurs while opening the ftp data channel. The CONNECT is
send
over the first socket which is connected as command channel. So I didn't get
the
second connection for data. I tried to fix this within the attached patch.

The second problem occurs while freeing memory. The function add_buffer_send
writes
behind a memory block. conn->proto.http is a "struct FTP" but the function
cast
the pointer to struct HTTP and then it does the following: http->sending =
HTTPSEND_BODY;
But struct HTTP is bigger then struct FTP. Something must be wrong with this
function or with my configuration. (FTP download via HTTP CONNECT tunneling)

I used the following version and configurations:
* libcurl 7.15.1
* only HTTP and FTP are enabled

Following options are set:
CURLOPT_URL -> ftp download url
CURLOPT_WRITEFUNCTION -> a correct function
CURLOPT_WRITEDATA -> a correct pointer as data
CURLOPT_HEADERFUNCTION -> a correct function
CURLOPT_WRITEHEADER -> a correct pointer as data
CURLOPT_FTP_USE_EPSV -> FALSE
CURLOPT_HTTPPROXYTUNNEL -> TRUE
CURLOPT_PROXYTYPE -> CURLPROXY_HTTP
CURLOPT_PROXY -> the url of my http proxy

The file is downloaded correctly but the freeing of conn->proto.generic
fails
in debug build while memory block is checked for changing data behind the
block. In release build the app crashs frequently.

The patches tries to correct the problem with the data channel and
introduce a not so fine workaround for the memory problem.

But perhaps I did something wrong ...

Regards,
Michael

_________________________________________________________________
Sie suchen E-Mails, Dokumente oder Fotos? Die neue MSN Suche Toolbar mit
Windows-Desktopsuche liefert in sekundenschnelle Ergebnisse. Jetzt neu!
http://desktop.msn.de/ Jetzt gratis downloaden!

Received on 2006-01-06