cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_FOLLOWLOCATION

From: Lorenzo Pastrana <pastrana_at_ultraflat.net>
Date: Mon, 9 Sep 2002 15:57:56 +0200

Hi,

I'm trying to use the redirection facilities in curl (using the multi
interface and CURLOPT_FOLLOWLOCATION for the easy handle set to true), but
can't figure out the behaviour I get...

The URL i'm trying to fetch looks this way :

http://www.domain.com/folder

I get a 301 (moved permanently) response, with the Location: header set to

http://www.domain.com/folder/

The debug CB states that curl is following to a new URL, but then, I reach :

msg->msg == CURLMSG_DONE
msg->data.result == CURLE_OK

without a single byte sent to the write CB and the stack appears to be empty
as the curl_multi_perform sets the running_handles to zero...

Needless to say that when I stick the Location: URL directly in the easy
handle from the beginning everyting runs OK.

Am I missing something in the setup?
Do I have to check the server's response code by hand anyway?
Aren't all 3XX-range response codes eligible for automated redirection?

Thanks.
Lo.

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
Received on 2002-09-09