1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00
Jay Satiro 97934a2f71 CURLOPT_HEADERFUNCTION.3: Document that size is always 1
For compatibility with `fwrite`, the `CURLOPT_HEADERFUNCTION` 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.

Reported-by: Frank Gevaerts
Commit-message-by: Christopher Head

Ref: https://github.com/curl/curl/pull/2787

Fixes https://github.com/curl/curl/issues/4758
2019-12-26 02:26:08 -05:00
..
2019-11-28 12:58:47 +01:00
2018-12-03 23:13:40 +01:00
2017-12-06 00:12:48 +01:00
2019-12-06 13:20:30 +01:00
2019-12-06 13:20:30 +01:00
FAQ
2019-11-26 08:32:23 +01:00
2018-11-01 10:29:53 +01:00
2019-12-06 13:20:30 +01:00
2019-12-06 13:20:30 +01:00
2018-09-23 22:24:02 +00:00
2019-11-28 12:58:47 +01:00
2018-06-03 12:14:45 +00:00
2019-12-06 13:20:30 +01:00
2019-11-28 12:58:47 +01:00
2011-12-30 03:53:25 +01:00
2018-10-12 21:04:37 +00:00
2018-09-23 22:24:02 +00:00
2018-09-23 22:24:02 +00:00
2017-12-04 09:15:39 +01:00
2019-11-05 16:50:55 +01:00
2018-09-23 22:24:02 +00:00
2019-11-28 12:58:47 +01:00
2015-06-10 00:21:06 +02:00

curl logo

Documentation

You'll find a mix of various documentation in this directory and subdirectories, using several different formats. Some of them are not ideal for reading directly in your browser.

If you'd rather see the rendered version of the documentation, check out the curl web site's documentation section for general curl stuff or the libcurl section for libcurl related documentation.