cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl PUT retry and READFUNCTION

From: Dan Fandrich <>
Date: Tue, 24 Jan 2012 21:23:00 -0800

On Wed, Jan 25, 2012 at 04:13:09AM +0000, Wenjun Chen wrote:
> The above code did not fix the problem. I added log message in call back funcgtions. The log output is as follows.
> 2012-01-24 22:59:22.000 (GMT-05:00) Write Data is 489 bytes
> 2012-01-24 22:59:22.000 (GMT-05:00) put_data_callback buff length 16372, data passed in 489 bytes
> 2012-01-24 22:59:22.000 (GMT-05:00) seek_data_callback, offset: 0, origin: 0, data len: 0
> Looks like the put_data_callback is not called again after seek_data callback with SEEK_SET operation(the seek_data_callback returns CURL_SEEKFUNC_OK) . Also the data passed back in seek_data_callback is not correct (the datalen should be 489, not 0). Maybe my implementation of seek_data_callback is not correct.

data_len is entirely controlled by your application's code; it's
entirely opaque to libcurl. If it's wrong when it's passed in to the
seek callback, then (barring a serious bug in libcurl), it is probably
being corrupted elsewhere. That seek data struct isn't stored on the
stack by any chance, is it?

>>> Dan
List admin:
Received on 2012-01-25