cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1187334 ] redirection error

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 21 Apr 2005 07:07:44 -0700

Bugs item #1187334, was opened at 2005-04-21 12:14
Message generated for change (Comment added) made by vdevaux
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1187334&group_id=976

Category: libcurl
Group: bad behaviour
>Status: Closed
Resolution: Works For Me
Priority: 5
Submitted By: virgile devaux (vdevaux)
Assigned to: Daniel Stenberg (bagder)
Summary: redirection error

Initial Comment:
I'm trying to developp a micro browser for a larger
project, using libcurl to handle the network related stuff.
i try to access the following url:
http://xxxxxxx/gestSmsgagn/index_audio.php4?CALLEDNUMBER=%220825105010%22&CMPT%5fAI=2&%5f%5fTIMESLOT%5f%5f=30&%5f%5fDTIDEVICE%5f%5f=dtiB1T11
using a GET method. This script redirect to a relative
path; here's the header of the response:

HTTP/1.1 302 Found
Date: Thu, 21 Apr 2005 11:53:12 GMT
Server: Apache/2.0.40 (Red Hat Linux)
mod_perl/1.99_05-dev Perl/v5.8.0 PHP/4.2.2
mod_ssl/2.0.40 OpenSSL/0.9.6b DAV/2
Accept-Ranges: bytes
X-Powered-By: PHP/4.2.2
Set-Cookie: PHPSESSID=a0fe69060bc378ae0d4f62b6be9c2b30;
path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate,
post-check=0, pre-check=0
Pragma: no-cache
Location: sequ_audio/entree.php4
Content-Length: 0
Content-Type: text/html; charset=ISO-8859-1

Instead of following the redirection to the url
http://xxxxxxx/gestSmsgagn/sequ_audio/entree.php4 curl
returns an error: "URL using bad/illegal format or
missing URL". The http code is 302 and the effective
uri becomes /sequ_audio/entree.php4 (yes with a slash
at the beginning!).
I know that a redirection must be an absolute url, and
certainly not a relative path, but is this behaviour
something known and not handle or just a bug?

uname -a : Linux XXXX 2.6.8-2-686-smp #1 SMP Mon Jan 24
02:32:52 EST 2005 i686 GNU/Linux (Its a debian)
curl 7.13.0 (i686-pc-linux-gnu) libcurl/7.13.0
OpenSSL/0.9.7e zlib/1.2.2 c-ares/1.2.0
Protocols: ftp http file https ftps
Features: AsynchDNS Debug Largefile NTLM SSL libz

thanks in advance for any response one might give.

----------------------------------------------------------------------

>Comment By: virgile devaux (vdevaux)
Date: 2005-04-21 14:07

Message:
Logged In: YES
user_id=1263772

should have check 2 hundred times instead of just one hundred.
my fault and mea maxima culpa; the char * i passed for the
uri to get was in fact a not so allocated std::string.
i sincerely apologizes.

----------------------------------------------------------------------

Comment By: virgile devaux (vdevaux)
Date: 2005-04-21 13:34

Message:
Logged In: YES
user_id=1263772

i added a trace in the debug callback that gives me this:

CURL DEBUG:(TEXT) About to connect() to
portal.jetmultimedia.fr port 80[010]
CURL DEBUG:(TEXT) Trying 194.153.89.141...
CURL DEBUG:(TEXT) connected[010]
CURL DEBUG:(TEXT) Connected to portal.jetmultimedia.fr
(194.153.89.141) port 80[010]
CURL DEBUG:(HEADER_OUT) GET
/gestSmsgagn/index_audio.php4?CALLEDNUMBER=%220825105010%22&CMPT%5fAI=2&%5f%5fTIMESLOT%5f%5f=30&%5f%5fDTIDEVICE%5f%5f=dtiB1T11
HTTP/1.1[013][010]User-Agent: JvmlBrowser[013][010]Host:
portal.jetmultimedia.fr[013][010]Pragma:
no-cache[013][010]Accept: */*[013][010][013][010]
CURL DEBUG:(HEADER_IN) HTTP/1.1 302 Found[013][010]
CURL DEBUG:(HEADER_IN) Date: Thu, 21 Apr 2005 13:30:22
GMT[013][010]
CURL DEBUG:(HEADER_IN) Server: Apache/2.0.40 (Red Hat Linux)
mod_perl/1.99_05-dev Perl/v5.8.0 PHP/4.2.2 mod_ssl/2.0.40
OpenSSL/
CURL DEBUG:(HEADER_IN) Accept-Ranges: bytes[013][010]
CURL DEBUG:(HEADER_IN) X-Powered-By: PHP/4.2.2[013][010]
CURL DEBUG:(TEXT) Added cookie
PHPSESSID="129b47e7d1e0b0aa58f4a7f5b430357b" for domain
portal.jetmultimedia.fr, path /, expire
CURL DEBUG:(HEADER_IN) Set-Cookie:
PHPSESSID=129b47e7d1e0b0aa58f4a7f5b430357b; path=/[013][010]
CURL DEBUG:(HEADER_IN) Expires: Thu, 19 Nov 1981 08:52:00
GMT[013][010]
CURL DEBUG:(HEADER_IN) Cache-Control: no-store, no-cache,
must-revalidate, post-check=0, pre-check=0[013][010]
CURL DEBUG:(HEADER_IN) Pragma: no-cache[013][010]
CURL DEBUG:(HEADER_IN) Location:
sequ_audio/entree.php4[013][010]
CURL DEBUG:(HEADER_IN) Content-Length: 0[013][010]
CURL DEBUG:(HEADER_IN) Content-Type: text/html;
charset=ISO-8859-1[013][010]
CURL DEBUG:(TEXT) Connection #0 to host
portal.jetmultimedia.fr left intact[010]
CURL DEBUG:(TEXT) Issue another request to this URL:
'/sequ_audio/entree.php4'[010]
CURL DEBUG:(TEXT) <url> malformed[010]

i will now try with another version of libcurl as it seems
to me there really is a problem (or perhaps i'm going
slightly mad...)
thanks for your immediate answer, by the way.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-04-21 12:54

Message:
Logged In: YES
user_id=1110

GET /gestSmsgagn/sequ_audio/entree.php4

Both my test versions did fine. curl 7.11.1 and 7.14.0-CVS.

It just works!

----------------------------------------------------------------------

Comment By: virgile devaux (vdevaux)
Date: 2005-04-21 12:42

Message:
Logged In: YES
user_id=1263772

No, i just can't figure it out unless a relative PATH in the
location header instead of an absolute uri leads to this
problem?
for a url, you can test at
http://portal.jetmultimedia.fr/gestSmsgagn/index_audio.php4?CALLEDNUMBER=%220825105010%22&CMPT%5fAI=2&%5f%5fTIMESLOT%5f%5f=30&%5f%5fDTIDEVICE%5f%5f=dtiB1T11
but it is perhaps not reachable from public. tell me, i'll
try to put it to another place.

for the thrid point, yes it's a strange behaviour; the
return code as retrieve by the CURLINFO_RESPONSE_CODE is
302. the CURLCODE returned by the easy_perform is
CURLE_URL_MALFORMAT. the effective uri as retrived by
CURLINFO_EFFECTIVE_URL is "/sequ_audio/entree.php4" with the
beginning slash.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-04-21 12:28

Message:
Logged In: YES
user_id=1110

We have more than 25 tests cases using Location: without
problems. Can you figure out what makes this special?

Can you provide us with a public URL that responds with a
Location: that causes this problem?

You say libcurl returns error CURLE_URL_MALFORMAT and in the
next sentense you say "the effective uri becomes...". What
do you mean?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1187334&group_id=976
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-tracker
Received on 2005-04-21

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET