cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issues on callback write_data

From: Gustavo Elias Siqueira <gumail_at_gmail.com>
Date: Mon, 26 Mar 2007 12:00:15 -0300

On Sun, 25 Mar 2007, Daniel wrote:

> But the issue still remains...
> The second callback have a bigger size, but no data avaiable.
Sorry, can you please elborate on what this means. What's bigger and if the
size is bigger, what do you mean with "no data available" ?

> I put some breakpoints right after perform line, and both chunk.memory and
> *mem just got a parcial data. The write_data function is called by libcurl
2
> times during the perform, but the data that I showed to you, I got at the
> fist callback...nothing in the second one.
I think you're wrong. The callback isn't even ever called if there's no data
provided to it.

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.

Thanks in advanced,

Gustavo
Received on 2007-03-26