cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: getinfo return value

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 2 Jan 2002 09:45:14 +0100 (MET)

On Wed, 26 Dec 2001, raoul cridlig wrote:

> When I download via proxy, the curl_easy_getinfo function is always
> returning code 43: CURLE_BAD_FUNCTION_ARGUMENT
>
> ...Even if the download is successful !!!

That error code is returned because you passed a bad parameter/argument to
the function. It has nothing to do with the download being successful or not.

> Ex:
> long *var;
> ......................;
> ..........PROXY.......;
> curl_easy_perform(...);
> cc = curl_easy_getinfo(curl, CURLINFO_HTTP_CODE,
> var);
> printf(......, cc);
>
> So why???

You pass a long pointer to the function that doesn't point to a valid long.
By accident (or luck), it turned out to be NULL and libcurl found out and
returned an error. It could just as well have destroyed some random memory as
you didn't initialize the pointer properly.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-01-02