cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl library on linux

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 9 May 2002 11:07:57 +0200 (MET DST)

On Wed, 8 May 2002, Hisseine Dj. wrote:

> I am using curl library to connect to a web server, this web server needs
> the user to be authenticate before doing anything.
>
> See this code:
>
> curl_handle = curl_easy_init();
> curl_easy_setopt(curl_handle, CURLOPT_URL, MyURL);
> curl_easy_setopt(curl_handle, CURLOPT_USERPWD, "Myuser:Mypass");
> curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, MyCallback);
> curl_easy_setopt(curl_handle, CURLOPT_FILE, (void *)&Mychunk);
> curl_easy_perform(curl_handle);
> curl_easy_cleanup(curl_handle);
>
> This will connect to the server and GET data and put it in the memory.
>
> The problem is that the data that I am getting is not complete (JPEG) or is
> corrupted?

If you got a 200 code back, the returned data should only be broken if:
1. The server sends you bad data
2. libcurl bugs
3. Your write callback function bugs
4. Something other I didn't think of right now.

I'd say that the option 3 is the most likely here. Option 1 is probably easy
checked with a normal browser. I don't think option 2 is very likely either
on this kind of simple transfer that are very often performed by users all
over.

> It seems that there is an authentication problem or data transfert, not
> sure !!!!

If there was a authentication problem, you wouldn't get a 200.

Now, if you still have this problem. You should include libcurl version and
an as detailed protocol dump as you can showing the transfer fail. Also, you
could include your code that receives the data.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth_at_sourceforge.net
Received on 2002-05-09