From 2a0c7ea4cc94a01c9396a213b2d0ccce6c05b37f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 29 Mar 2011 11:19:49 +0200 Subject: [PATCH] curl_easy_setopt.3: mention TFTP read callback flaw The read callback must return the exact requested amount of data when it is used for doing TFTP uploads. This is due to how it deals with data internally. This could/should be fixed but for now we document the existing behavior. Reported by: Colin Blair Bug: http://curl.haxx.se/mail/lib-2011-03/0319.html --- docs/libcurl/curl_easy_setopt.3 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3 index 6166d5fd5..16f4b5842 100644 --- a/docs/libcurl/curl_easy_setopt.3 +++ b/docs/libcurl/curl_easy_setopt.3 @@ -208,6 +208,10 @@ From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP for further details. +\fBBugs\fP: when doing TFTP uploads, you must return the exact amount of data +that the callback wants, or it will be considered the final packet by the +server end and the transfer will end there. + If you set this callback pointer to NULL, or don't set it at all, the default internal read function will be used. It is doing an fread() on the FILE * userdata set with \fICURLOPT_READDATA\fP.