CURLOPT_HEADERFUNCTION.md: do not modify the passed in buffer

Closes #15148
This commit is contained in:
Daniel Stenberg 2024-10-04 13:53:20 +02:00
parent 6f454bab75
commit 0b864bde08
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -43,12 +43,12 @@ shown above.
This callback function gets invoked by libcurl as soon as it has received
header data. The header callback is called once for each header and only
complete header lines are passed on to the callback. Parsing headers is easy
to do using this callback. *buffer* points to the delivered data, and the
size of that data is *nitems*; *size* is always 1. The provide header
line is not null-terminated!
to do using this callback. *buffer* points to the delivered data, and the size
of that data is *nitems*; *size* is always 1. The provided header line is not
null-terminated! Do not modify the passed in buffer.
The pointer named *userdata* is the one you set with the
CURLOPT_HEADERDATA(3) option.
The pointer named *userdata* is the one you set with the CURLOPT_HEADERDATA(3)
option.
Your callback should return the number of bytes actually taken care of. If
that amount differs from the amount passed to your callback function, it