diff mbox series

[14/29] channel_curl: pass channel_data to headers callback

Message ID 20211011112156.44192-15-sbabic@denx.de
State Changes Requested
Headers show
Series DELTA Update | expand

Commit Message

Stefano Babic Oct. 11, 2021, 11:21 a.m. UTC
Headers callback collects the headers in a distionary and receive as
parameter the pointer to it. The callback can require more information
if the headers must be evaluated, then pass the curl's setup
(channel_data_t) instead of just the dictionary.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 corelib/channel_curl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c
index be553f0..20323b7 100644
--- a/corelib/channel_curl.c
+++ b/corelib/channel_curl.c
@@ -450,7 +450,8 @@  static int channel_callback_xferinfo_legacy(void *p, double dltotal, double dlno
 
 static size_t channel_callback_headers(char *buffer, size_t size, size_t nitems, void *userdata)
 {
-	struct dict *dict = (struct dict *)userdata;
+	channel_data_t *channel_data = (channel_data_t *)userdata;
+	struct dict *dict = channel_data->received_headers;
 	char *info = malloc(size * nitems + 1);
 	char *p, *key, *val;