cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issues on callback write_data

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 26 Mar 2007 11:09:41 -0700

On Mon, Mar 26, 2007 at 12:00:15PM -0300, Gustavo Elias Siqueira wrote:
> Hi Daniel, thanks for you help. I'm afraid that I attacking the list with many
> msgs. I gonna try explain exact whats its happening.
> During the perform function, the libcurl call my callback write_data:
> Putting a breakpoint at write_data, I checked all functions parameters, I got
> this values:
>
> size_t size = 1
>
> size_t nmemb = 1452
>
> mem->memory ( After memcpy function ) = "<!DOCTYPE HTML PUBLIC "-//W3C//DTD
> HTML 4.01 Transitional//EN"><html lang="en"><head><title>CNN.com - Breaking
> News, U.S., World, Weather, Entertainment &amp; Video News</title> <meta
> http-equiv="content-type" content="text/html; charset=iso-8859-1"
>
> So I pressed F5 to continue Debug. The function is called again with theses
> values:
>
> size_t size = 1
>
> size_t nmemb = 8712
>
> mem->memory ( After memcpy function ) = "<!DOCTYPE HTML PUBLIC "-//W3C//DTD
> HTML 4.01 Transitional//EN"><html lang="en"><head><title>CNN.com - Breaking
> News, U.S., World, Weather, Entertainment &amp; Video News</title> <meta
> http-equiv="content-type" content="text/html; charset=iso-8859-1"
>
> That's why I told you "no data avaiable", its because, mem-> memory doesnt
> change value after the first callback. I hope that was a better explanation.

I think what you're seeing is a debugger artifact, not an actual bug. The
first data set you show above isn't 1452 characters, either--it's only 254.
I suspect your debugger is truncating the output, not curl. Try inserting
something into your code to display the entire buffer, or look at the data
in some other way in your debugger, like in a hexidecimal memory dump mode.

Do you have any other reason to believe that libcurl isn't working
correctly?

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-03-26