cURL / Mailing Lists / curl-library / Single Mail

curl-library

Correct way to retrieve error code in case of multi interface

From: Lijo Antony <lta_at_one.com>
Date: Sun, 05 Feb 2012 19:30:09 +0400

Hello,

I am using curl multi interface (socket_action) for http/https transfers
and would like to know the correct way to retrieve error codes
associated with a transfer.

Currently I am using curl_easy_getinfo with CURLINFO_RESPONSE_CODE and
CURLINFO_OS_ERRNO to do this. But this doesn't give the specific error
code like curl_easy_perform would return. For example, when network is
down, I get CURLINFO_RESPONSE_CODE and CURLINFO_OS_ERRNO as 0, even
though I can see debug log as "Could not resolve host: <url> (Could not
contact DNS servers)".

In error scenarios like these (dns error, connect error, ssl errors
etc), I would like to get the specific error code. How can I achieve this?

Thanks in advance,
-lijo
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-05