[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 29/153: docs/CURLOPT_WRITEFUNCTION: size is always
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 29/153: docs/CURLOPT_WRITEFUNCTION: size is always 1 |
Date: |
Tue, 11 Sep 2018 12:51:40 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 9526cbe6bca1f9389fa84e5b0e5e2dc173e82f0d
Author: Christopher Head <address@hidden>
AuthorDate: Tue Jul 24 22:47:23 2018 -0700
docs/CURLOPT_WRITEFUNCTION: size is always 1
For compatibility with `fwrite`, the `CURLOPT_WRITEFUNCTION` callback is
passed two `size_t` parameters which, when multiplied, designate the
number of bytes of data passed in. In practice, CURL always sets the
first parameter (`size`) to 1.
This practice is also enshrined in documentation and cannot be changed
in future. The documentation states that the default callback is
`fwrite`, which means `fwrite` must be a suitable function for this
purpose. However, the documentation also states that the callback must
return the number of *bytes* it successfully handled, whereas ISO C
`fwrite` returns the number of items (each of size `size`) which it
wrote. The only way these numbers can be equal is if `size` is 1.
Since `size` is 1 and can never be changed in future anyway, document
that fact explicitly and let users rely on it.
Closes #2787
---
docs/libcurl/opts/CURLOPT_WRITEFUNCTION.3 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.3
b/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.3
index 2c77a4c1b..b6cdabf70 100644
--- a/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.3
+++ b/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.3
@@ -36,7 +36,7 @@ shown above.
This callback function gets called by libcurl as soon as there is data
received that needs to be saved. \fIptr\fP points to the delivered data, and
-the size of that data is \fIsize\fP multiplied with \fInmemb\fP.
+the size of that data is \fInmemb\fP; \fIsize\fP is always 1.
The callback function will be passed as much data as possible in all invokes,
but you must not make any assumptions. It may be one byte, it may be
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 41/153: examples/ephiperfifo: checksrc compliance, (continued)
- [GNUnet-SVN] [gnurl] 41/153: examples/ephiperfifo: checksrc compliance, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 62/153: windows: follow up to the buffer-tuning 1ba1dba7, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 59/153: CMake: Respect BUILD_SHARED_LIBS, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 33/153: mime: check Curl_rand_hex's return code, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 54/153: lib/Makefile: only do symbol hiding if told to, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 38/153: tests/http_pipe.py: Use /usr/bin/env to find python, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 57/153: cmake: link curl to the OpenSSL targets instead of lib absolute paths, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 48/153: mailmap: Daniel Jelinski, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 42/153: travis: run a 'make checksrc' too, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 46/153: curl: use Content-Disposition before the "URL end" for -OJ, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 29/153: docs/CURLOPT_WRITEFUNCTION: size is always 1,
gnunet <=
- [GNUnet-SVN] [gnurl] 58/153: cmake: bumped minimum version to 3.4, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 26/153: system_win32: fix version checking, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 56/153: travis: build darwinssl on macos 10.12, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 25/153: auth: pick Bearer authentication whenever a token is available, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 45/153: retry: return error if rewind was necessary but didn't happen, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 53/153: hostip: fix unused variable warning, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 47/153: HTTP: Don't attempt to needlessly decompress redirect body, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 23/153: test320: treat curl320.out file as binary, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 44/153: http2: clear the drain counter in Curl_http2_done, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 01/153: examples/crawler.c: move #ifdef to column 0, gnunet, 2018/09/11