cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: conn->proto.ftp == NULL in Curl_ftp_done

From: Armel Asselin <asselin.armel_at_wanadoo.fr>
Date: Sat, 16 Sep 2006 12:30:19 +0200

>>> add : if (ftp == NULL) return result;
>>> before any use of 'ftp' variable.
>>
>> But the fact that 'ftp' is NULL at that point is in itself an error. The
>> Curl_ftp_done() is called unconditionally after a transfer has been done
>> (from Curl_done), and at that point there MUST be a SessionHandle struct
>> associated with the connection.
>>
>> So, any chance you can stuff the code with some debug code or similar to
>> find out more details around when this problem occurs?
> if I can repeat the error in a predicitive way i will.
OK, I think that I found how to reproduce the problem.
When the easy handle is removed from the multi while libcurl is still trying
to resolve the name of the proxy, it seems that the ftp struct is not yet
initialized at that time(?)... but the removal action calls Curl_done stuff,
hence the crash.

BTW, can I use a URL such as "http://armel:pwd@192.168.1.101:3128" as a
proxy specification (into CURLOPT_PROXY)? because my problems come when
'pwd' is missing (leaving "armel:@", it seems that libcurl then tryies to
resolve 'armel' as server and '@192...' as port or something like that)
would "socks://..." work as well? (or socks4 / socks5?)

Regards
Armel
Received on 2006-09-16