curl-library
Bug !!! Redirection code 301 generate a segmentation fault
Date: Thu, 9 Oct 2003 22:56:44 +0200
Hi Folks,
I'm using libCurl C interface (the latest version 7.10.7) on a
Suse 8.2, PIII 1Go, 512Mo.
I think that I found a bug when I've a "Redirection code 301".
When I try to fetch this URL :
http://www.tf1.fr/TF1/Tr/Stats/Compteur/genereClickURL/1,,,00.html
I've got a segmentation fault error.
It seems that the page is "Moved Permanently 301" but there is
nothing in the "Location:" header to point the new URL.
Could anyone fix it?
This is the headers with the verbose mode :
~/test> ./simple
* About to connect() to www.tf1.fr:80
* Connected to www.tf1.fr (195.68.47.6) port 80
> GET /TF1/Tr/Stats/Compteur/genereClickURL/1,,,00.html HTTP/1.1
Host: www.tf1.fr
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
< HTTP/1.1 301 Moved Permanently
HTTP/1.1 301 Moved Permanently
< Server: Microsoft-IIS/5.0
Server: Microsoft-IIS/5.0
< Date: Thu, 09 Oct 2003 20:28:21 GMT
Date: Thu, 09 Oct 2003 20:28:21 GMT
< Location:
Location:
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Via: 1.1 tx2 (Redline Networks Web I/O Accelerator - T|X
3.1.0 0)
Via: 1.1 tx2 (Redline Networks Web I/O Accelerator - T|X 3.1.0 0)
* Connection #0 left intact
Erreur de segmentation (<---segmentation fault)
This is my source code in "simple.c" :
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_URL,
"http://www.tf1.fr/TF1/Tr/Stats/Compteur/genereClickURL/1,,,00.html");
res = curl_easy_perform(curl);
printf ("res : %n", res);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
Thanks,
Younès
Accédez au courrier électronique de La Poste : www.laposte.net ;
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
Received on 2003-10-09