cURL / Mailing Lists / curl-library / Single Mail

curl-library

Curl ftp crash if server is down

From: LucaMt <lucamt74_at_gmail.com>
Date: Wed, 14 Nov 2012 17:45:46 +0100

Dear All,
I'm using curl library on ARM processor and lib version info reporting:
Curl version: 7.15.1
Curl ssl_version: OpenSSL/0.9.8e
Curl libz_version: 1.2.3
Curl Supported protocols:
0. tftp
1. ftp
2. gopher
3. telnet
4. dict
5. ldap
6. http
7. file
8. https
9. ftps

I have a segmentation fault on curl_easy_perform if my ftp server is down

This is my code:
curl_easy_setopt(curl, CURLOPT_USERPWD,"ABC:ABC");
curl_easy_setopt(curl, CURLOPT_URL,"ftp://10.31.43.55/pippo.txt");

curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);

curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);

curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

curl_easy_setopt(curl, CURLOPT_FTP_USE_EPSV, 0L);

curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);

res = curl_easy_perform(curl);

curl_easy_cleanup(curl);

if(CURLE_OK != res) {
        cout<<"Error code="<<res<<endl;
        retVal = -1;
}else{
        cout<<"FTP GET OK"<<endl;
}

There is something wrong ? Any idea

Thanks

Luca

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-14