cURL / Mailing Lists / curl-library / Single Mail


Possible tftp Problem

From: Colin Blair (colblair) <>
Date: Tue, 29 Mar 2011 15:36:22 +0800


I have a question about tftp support in curl.

When I code an application with a read callback function and initiate
curl I see the callback function get called with a buffer size of 512
bytes. If I return a value of 512 bytes the callback function will be
called until I return a value of less than 512 bytes. However, once I
return a value less than 512 bytes, the callback function is never
called again.

According to the curl documentation:

"When you call curl_easy_perform(3) this time, it'll perform all the
necessary operations and when it has invoked the upload it'll call your
supplied callback to get the data to upload. The program should return
as much data as possible in every invoke, as that is likely to make the
upload perform as fast as possible. The callback should return the
number of bytes it wrote in the buffer. Returning 0 will signal the end
of the upload."

When using the file: protocol the callback functions work exactly as
described in the documentation quoted above. I can return any value from
the callback function and it will get called repeatedly until the
function returns 0.

Is this a bug in the tftp support for curl? I would have expected the
callback function to be called by curl the same way as it is for the
file: protocol.


List admin:
Received on 2011-03-29