cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [cURLpp] curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies) fails

From: Igor <lanthruster_at_gmail.com>
Date: Thu, 24 Jan 2008 18:35:18 +0300

Hello libcurl,

> Hi,

> I am still unable to run the attached code successfully even with 7.17.0.
> Basically I am trying to build and execute curl-7.17.0
> /docs/examples/cookie_interface.c
> It fails in the function static void print_cookies(CURL *curl) at line
> number 28
> res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
> It says :
> Curl curl_easy_getinfo failed: a libcurl function was given a bad
> argument

  That most probably mean that your library was compiled without
  CURLIFNO_COOKIELIST macro. Wile looking through different
  libcurl versions I've noticed that some packages by reasons
  unknown lack some macros. They disappear in one packages and then
  reappear in another. My guess is that you have had that kind of
  library. Check out your curl.h. That only can happen if you include
  curl.h that does have CURLIFNO_COOKIELIST but you link your app with
  library that was compiled with curl.h that didn't have
  CURLIFNO_COOKIELIST.
  
.......................
  case CURLINFO_COOKIELIST:
    *param_slistp = Curl_cookie_list(data);
    break;
  case CURLINFO_LASTSOCKET:
    if((data->state.lastconnect != -1) &&
       (data->state.connects[data->state.lastconnect] != NULL))
      *param_longp = data->state.connects[data->state.lastconnect]->
        sock[FIRSTSOCKET];
    else
      *param_longp = -1;
    break;
  default:
    return CURLE_BAD_FUNCTION_ARGUMENT;
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    that is your case.

-- 
Best regards,
 Igor                          mailto:lanthruster_at_gmail.com
Received on 2008-01-24