From 5b41fac587b55b489bdf8355306472bf7315ffbc Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 6 Feb 2024 12:10:19 +0100 Subject: [PATCH] sendf: Curl_client_write(), make passed in buf const --- docs/CLIENT-WRITERS.md | 2 +- lib/sendf.c | 2 +- lib/sendf.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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; /** -- 2.47.3