cURL / Mailing Lists / curl-library / Single Mail

curl-library

Strange header from https connection

From: Tomaz Noleto <tnoleto_at_gmail.com>
Date: Thu, 3 Aug 2006 17:48:55 -0400

Hi all,

I implemented a simple function to retrieve header from a https url, but
header has been coming with 2 different status code responses (from
different http versions) and this Proxy-Agent field duplicated, like this:

(prints from header function callback)

HTTP/1.0 200 Connection established
Proxy-Agent: NetCache NetApp/5.6.2R1

Proxy-Agent: NetCache NetApp/5.6.2R1

HTTP/1.1 200 OK
Last-Modified: Wed, 12 Jul 2006 14:59:01 GMT
Content-Type: image/jpeg
Content-Length: 7413
Cache-control: private
Date: Thu, 03 Aug 2006 21:07:05 GMT
Server: GFE/1.3

These are the curl options I set:
...
curl_easy_setopt(handler, CURLOPT_URL, "
https://www.google.com/adsense/images/sample.jpg");
curl_easy_setopt(handler, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(handler, CURLOPT_HEADERFUNCTION, curl_ask_header_cb);
curl_easy_setopt(handler, CURLOPT_WRITEFUNCTION, curl_write_data_cb);

/* To check if the header comes with Content-Range field */
curl_easy_setopt(handler, CURLOPT_RESUME_FROM, 10);
curl_easy_setopt(handler, CURLOPT_SSL_VERIFYPEER, FALSE);
...

Is it normal behaviour or could it be some kind of server/libcurl
peculiarity (or even error of my app)? Which situations could cause that? My
application needs to know the actual status code response so I can handle it
the correct way (e.g., if I get 401 response, I will call the function again
and set CURLOPT_USERPWD option to authenticate, and stuff like that) and
this kind of breaks the pattern I I had implemented to retrieve it.

Thanks in advance.

-- 
Tomaz Nolęto
Laboratório de Linux Embarcado (10LE)
Instituto Nokia de Tecnologia (INdT)
tomaz.noleto_at_indt.org.br / tnoleto_at_gmail.com
Received on 2006-08-03