cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_getinfo() for CURLINFO_RESPONSE_CODE does not work for ICY URLs

From: <centrio_at_gmail.com>
Date: Fri, 27 Mar 2009 04:37:03 +0000

Hi
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 26 Mar 2009 16:24:31 +0100 (CET)

On Thu, 26 Mar 2009, centrio_at_gmail.com wrote:

> curl_slist aliases = 0;

>> That seems unlikely to be fine to the compiler.

Sorry my mistake. The usage is like this
curl_slist* aliases = 0;

> aliases = curl_slist_append(aliases, "ICY 401 Service Unavailable");
> curl_easy_setopt(curlHandle, CURLOPT_HTTP200ALIASES, aliases);

>> Are you seriously saying that "401 Service Unavailable" should be equal
>> to 200
>> OK? It sounds a bit strange in my ears...

Yes I am saying this, since I am not aware of any method by which I can get
this message as a header callback instead of a data callback.
I dont want any ICY 400 or HTTP 400 messages in data callback.
If I dont give this aliases as HTTP200ALIASES, ICY 400... message comes in
the data callback.

> However when I get a URL whose response code is ICY 401, libcurl does not
> return this code through the API. If I use curl_easy_getinfo(), it returns
> me 0 for URLs which return ICY 400 or any other code which is not 200.

> Can you tell me why getinfo() does not return the actual response code for
> the ICY URLs.??

>> Because there's no support for that kind of stunt and I don't even
>> understand
>> why you thought so in the first place. The "ICY" thing is an abomination
>> as it
>> is already, let's not continue that silliness any further.

Since HTTP 400.. response can be treated as HTTP 200 OK,
I thought ICY will also work. The get_info API workd fine if I give HTTP
400 in aliases.
So why not ICY 400. Its a different matter if libcurl has not considered
this, I will have to parse it and get the response code. Let me know if I
should do it by parsing, or there is any work around for this.
Received on 2009-03-27