diff mbox series

[03/13] channel_curl: rename put_read_callback to read_callback

Message ID 20231120154731.44988-4-stefano.babic@swupdate.org
State Accepted
Headers show
Series [01/13] configs: update after removing CONFIG_HANDLER_IN_LUA | expand

Commit Message

Stefano Babic Nov. 20, 2023, 3:47 p.m. UTC
The callback should be generic because it could be called even by other
methods and not just in case of "PUT".

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 corelib/channel_curl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c
index 9842d7a5..2da49ce3 100644
--- a/corelib/channel_curl.c
+++ b/corelib/channel_curl.c
@@ -888,7 +888,7 @@  cleanup:
 	return result;
 }
 
-static size_t put_read_callback(void *ptr, size_t size, size_t nmemb, void *data)
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *data)
 {
 	channel_data_t *channel_data = (channel_data_t *)data;
 	unsigned int bytes;
@@ -1041,7 +1041,7 @@  static channel_op_res_t channel_post_method(channel_t *this, void *data, int met
 						CURLOPT_PUT,
 						#endif
 						1L) ||
-			curl_easy_setopt(channel_curl->handle, CURLOPT_READFUNCTION, put_read_callback) ||
+			curl_easy_setopt(channel_curl->handle, CURLOPT_READFUNCTION, read_callback) ||
 			curl_easy_setopt(channel_curl->handle, CURLOPT_INFILESIZE_LARGE,
 					(curl_off_t)strlen(channel_data->request_body)) ||
 			curl_easy_setopt(channel_curl->handle, CURLOPT_READDATA, channel_data);