From 7d4d4892d8cddd14ab48db9991db893035a7a938 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 May 2013 10:49:50 +0200 Subject: curl_easy_setopt.3: expand the PROGRESSFUNCTION section Explain the callback and its arguments better and with more descriptive text. --- docs/libcurl/curl_easy_setopt.3 | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3 index bc81ac846..742f3a18a 100644 --- a/docs/libcurl/curl_easy_setopt.3 +++ b/docs/libcurl/curl_easy_setopt.3 @@ -346,11 +346,24 @@ Pass a pointer to a function that matches the following prototype: \fBint function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); \fP. This function gets called by libcurl instead of its internal equivalent with a frequent interval during operation (roughly once per second -or sooner) no matter if data is being transferred or not. Unknown/unused -argument values passed to the callback will be set to zero (like if you only -download data, the upload size will remain 0). Returning a non-zero value from -this callback will cause libcurl to abort the transfer and return -\fICURLE_ABORTED_BY_CALLBACK\fP. +or sooner) no matter if data is being transferred or not. + +\fIclientp\fP is the pointer set with \fICURLOPT_PROGRESSDATA\fP, it is not +actually used by libcurl but is only passed along from the application to the +callback. + +The callback gets told how much data libcurl will transfer and has +transferred, in number of bytes. \fIdltotal\fP is the total number of bytes +libcurl expects to download in this transfer. \fIdlnow\fP is the number of +bytes downloaded so far. \fIultotal\fP is the total number of bytes libcurl +expects to upload in this transfer. \fIulnow\fP is the number of bytes +uploaded so far. + +Unknown/unused argument values passed to the callback will be set to zero +(like if you only download data, the upload size will remain 0). + +Returning a non-zero value from this callback will cause libcurl to abort the +transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP. If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl -- cgit v1.2.3