cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to get char info from curl_easy_getinfo()

From: David Szafranski <dszafranski_at_wanadoo.fr>
Date: Mon, 26 May 2003 23:10:16 +0200

> I can use curl_easy_getinfo() to return both
> long and double data, but it fails to return
> data into a string address. I am calling the
> function as follows:
>
> type$ = NULL$ (256) ' create buffer string
> curl_easy_getinfo (curl_handle, $$CURLINFO_CONTENT_TYPE, &type$)
> type$ = CSIZE$ (type$) ' remove null chars
>
> I get returned a few non ascii characters. I
> get the same thing if I use CURLINFO_EFFECTIVE_URL.

I can answer this myself...after actually
applying a few brain cells.

The function returns a pointer to the string.
It doesn't fill a supplied string buffer.

So this works fine:

curl_easy_getinfo (curl_handle, $$CURLINFO_CONTENT_TYPE, &typeAddr)
type$ = CSTRING$ (typeAddr)

ciao,
D.

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
Received on 2003-05-26