diff mbox series

[V2,17/36] channel_curl: pass channel_data to headers callback

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

Commit Message

Stefano Babic Nov. 14, 2021, 5:27 p.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 a44370b..4ae2bed 100644
--- a/corelib/channel_curl.c
+++ b/corelib/channel_curl.c
@@ -452,7 +452,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;