1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -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
..
ABI
2015-07-30 15:02:44 +02:00
2018-09-23 22:24:02 +00:00
2018-09-23 22:24:02 +00:00
2019-08-09 12:26:02 +02:00
2017-09-02 17:47:10 +01:00
2018-04-17 15:32:51 -04:00
2018-04-17 15:32:51 -04:00
2017-09-05 17:55:51 +01:00
2018-04-17 15:32:51 -04:00
2018-04-17 15:32:51 -04:00
2018-09-23 22:24:02 +00:00
2018-09-23 22:24:02 +00:00
2018-09-23 22:24:02 +00:00
2018-09-23 22:24:02 +00:00
2014-08-29 16:41:17 +02:00
2018-04-17 15:32:51 -04:00
2016-05-20 16:05:39 +02:00
2018-05-15 16:41:55 +02:00
2019-11-25 15:45:56 +01:00