cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_HEADERFUNCTION with non-HTTP response ?

From: ruffnex <ruffnex_at_mac.com>
Date: Fri, 8 Nov 2002 23:34:37 +0800

Hi all,

I am connecting libcurl to a Shoutcast/Icecast stream. The response is in
the standard HTTP response format, which I want to separate from the binary
data that follows e.g.

ICY 200 OK
icy-name:Music One - Today's Dance www.m1live.com
icy-genre:Dance;Trance;European
icy-url:http://www.m1live.com
icy-pub:1
icy-br:128

<data...>

CURLOPT_HEADERFUNCTION does not invoke my callback because the initial
response header is "ICY 200 OK" and is not of the form "HTTP/1.1 200 OK",
which does invoke the callback.

Is there any way to set up libcurl to recognise a 'custom response' so that
the callback is invoked?

Otherwise, I'll need to implement code within my WRITEDATA callback
function to parse the headers. I'd like to avoid this if possible.

Thanks,
Simon Liu

-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
Received on 2002-11-08