From: Stefan Eissing Date: Tue, 6 Feb 2024 11:10:19 +0000 (+0100) Subject: sendf: Curl_client_write(), make passed in buf const X-Git-Tag: curl-8_7_0~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b41fac587b55b489bdf8355306472bf7315ffbc;p=thirdparty%2Fcurl.git sendf: Curl_client_write(), make passed in buf const --- diff --git a/docs/CLIENT-WRITERS.md b/docs/CLIENT-WRITERS.md index 7a928826ca..a2a175b72c 100644 --- a/docs/CLIENT-WRITERS.md +++ b/docs/CLIENT-WRITERS.md @@ -14,7 +14,7 @@ With this naming established, client writers are concerned with writing response All code in `libcurl` that handles response data is ultimately expected to forward this data via `Curl_client_write()` to the application. The exact prototype of this function is: ``` -CURLcode Curl_client_write(struct Curl_easy *data, int type, char *buf, size_t blen); +CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf, size_t blen); ``` The `type` argument specifies what the bytes in `buf` actually are. The following bits are defined: diff --git a/lib/sendf.c b/lib/sendf.c index 8accc17964..f37cee5d93 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -296,7 +296,7 @@ static CURLcode chop_write(struct Curl_easy *data, The defines are in sendf.h of course. */ CURLcode Curl_client_write(struct Curl_easy *data, - int type, char *buf, size_t blen) + int type, const char *buf, size_t blen) { CURLcode result; diff --git a/lib/sendf.h b/lib/sendf.h index 7deae2ac3c..4d4f01e4f5 100644 --- a/lib/sendf.h +++ b/lib/sendf.h @@ -55,7 +55,7 @@ * Write `len` bytes at `prt` to the client. `type` indicates what * kind of data is being written. */ -CURLcode Curl_client_write(struct Curl_easy *data, int type, char *ptr, +CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *ptr, size_t len) WARN_UNUSED_RESULT; /**