From patchwork Sun Nov 14 17:27:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1554907 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=tedMMFUb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::338; helo=mail-wm1-x338.google.com; envelope-from=swupdate+bncbcxploxj6ikrbmeoywgamgqehiiuumi@googlegroups.com; receiver=) Received: from mail-wm1-x338.google.com (mail-wm1-x338.google.com [IPv6:2a00:1450:4864:20::338]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HsfRl6w7Nz9sX3 for ; Mon, 15 Nov 2021 04:28:19 +1100 (AEDT) Received: by mail-wm1-x338.google.com with SMTP id 144-20020a1c0496000000b003305ac0e03asf8879415wme.8 for ; Sun, 14 Nov 2021 09:28:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636910896; cv=pass; d=google.com; s=arc-20160816; b=Zh8Ha3BgCQI2/XnFUvzW3er4BLwP7JWzIdkZOdQtIqjCacQu2HyaBvYNp6JxRy7vgT i78nJv69sjYrop/irRh14EAwzIc9gbl7KmDBjD4h3hh5SU8GQIreuBwK5AtmrGJ/ha60 b5/ZkX7brlxB2RydZEnbLBGKU/fNvvUFsa39an4zbICWDcHwsGQzGJJdkMN6DEq45qbD SA34evUOBZPysHMCfJ2Fyb3AJ4ID4DCvqAQU4p9/F8wdMjtkIrgCx/yjMiQIl7fW/zOA chYz4vyvpOCO8w9Cnmh+Y4dreUwX+SPhHDxB6geIoZlZrfwnBuVXcEeheHL71XH2K4Ab v1qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=DJfYzLDnECsDb1Bd0/xZMRbHRx8E4BzLJDy7HrqJlsU=; b=U+DzIo14tYQJG2iyH1WrG00n3ypaDMOH38/LY+K4wTykVfjAJ9qRNE078wr/FN/qVV orTUzIwKa0bf7tj3weBsefg6VDr0EYR+mppiNgdtykNgJvmH2/Hr0TWFufQeZSoHqOsZ fECcfisc59doQWnIbngLQLclKfLsdcPaKvaupTOQUia6ot7n1K1l0LtduaFmJZelbgHF rCFpxHiN1xtTYNQ7owumXBjbiZhFhUMBJPPfBXLXPSVgR+PhcJ8xDpo0WA4mW6ra7+ir xa2doOHyg0tC7oMI514U+Wll5l7wtoPvB9ykk7vb0Iqv0xqjSWSf2HuhXx58YKTjJf6p 4abw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=DJfYzLDnECsDb1Bd0/xZMRbHRx8E4BzLJDy7HrqJlsU=; b=tedMMFUb3ZGslNyzpJKivfJlrn72cnzAmxIttvnFyTQXHWmS3+7gzfkkP8XOCBtYlR rrNzQ8XiVG73XyCgpeUJupeDiABDCpw4x9W9l9Z+X7ZrHvQzV8p8U+J5bwIPiCUs7ql1 eLvB92HXm2Lo7DLrqeiUYhZr5HQPI3TzEvLYO0ssCLjhXeyh1maCypkrKk48Pttlwlju KC/PPKlrQDcr+hujfBu0uCRlQn4KlmTokNQgnwhlpt4uieo3DcJzLFpSsVkaUdgGgViG FRqvPp2vv68Dq0cN++bOMrrcRcX9ZzDJkguf2B2BHnigMgPlIChywF0iWdgBaek+xdHQ UXng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=DJfYzLDnECsDb1Bd0/xZMRbHRx8E4BzLJDy7HrqJlsU=; b=WDjvV6CW2oEDxUCgSNV4D25/c5MR10Zd9v/u2TGiW6O5aVd4BWKwWAjE/pw0NieWxQ 8yFcKb4xypjWxR7ZAdGx2asIpH+YaoDA084TyWKJPxwTsRq9qHwNHsPmOxpdcStRD6+t 716+QbJouAByRFWLyL5IViUDcvml7xEEd6hAsTLfjC6FEoJuHYUAoVUNZ+VJpSBUr4BU ImILepJ2rX2+F+LXpFFs6u+hjyWrPTaqjbNrqA2EIMebG2MoEXJhTKz1VaA3OnqpQ28f F3N7ZCqgweYEcThVEFdMirK4Y+JCLKZPXzHpgXAgNgSAvrYpumu3u69KhxocYrqT55Qm CmcA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530YipXyyDIVkASISqXHKLY8NmVC83Xof53PkYW6vvUzd69rq1Wc FD88SSYXrkPJaXPgrXpftDM= X-Google-Smtp-Source: ABdhPJx2nKU6yxssovE80K7fuNY/MOA66nxjz404p9V0x8c+ZJTHuykFCXMANp/GzBY/r9KmvBBNVg== X-Received: by 2002:a1c:7715:: with SMTP id t21mr35320264wmi.183.1636910896823; Sun, 14 Nov 2021 09:28:16 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:ad6:: with SMTP id c22ls9086456wmr.1.canary-gmail; Sun, 14 Nov 2021 09:28:16 -0800 (PST) X-Received: by 2002:a05:600c:6016:: with SMTP id az22mr51943739wmb.11.1636910896163; Sun, 14 Nov 2021 09:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636910896; cv=none; d=google.com; s=arc-20160816; b=W6qKV1cKHUaq2elblo2Ob8/FyKdYvm7gnXpDgjJ3wiueIxgvC7d2CSCejrJkJzJJze ZV9dSJP7USRGe4AGf/9X4LL+saUV7PRpcxsmu7iwqr0CAMLHuO2LDfDdfd0AXYFd6fCH MZDczckCTr84LByyv9h9hr08Mbsi0/0RWBBJ9v58Lf8mj0g08XaI3n0aZaFwgTtkqtws BV/H3WjZ6qjzfx4Dw/DSXmCiPWQ9bIDxlvWL8qXlOmsBG1KM370L4q1f/GhI1iA2oOvQ 1ll2y+DIuQdKu62uZNun0z8C7U4zvn584q82W+9Y55qSxIeTVsBJ2qVRwlD/cfXC9Af9 uf/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=dHp+0yNnv0bcFNydsT7MzK9iqa3rFd/1HbMF+1yCPfY=; b=ZxzDUOkYWHjyYWX6p1xUJ//wfPMgmrTVGg45LX1wdARZ0AdeTdtb90k2CAByGtfqaA VXUpZYue2/eKw/Sv0K/AGpFGDVimSZ4aDZmzlT5J37T29+9QSHiYwvF+P9sOYbL7Kg/8 6tqbmyz2HpSNKOqZwaWX6O+o/O4F9u6xeYZP97YS0jcP9VpDZIHA5C8Bvp4H3AlNn/58 lLgjZosBOeyZnb5jUmsmOomd0AhPaR2DsmEFGmq47xhAEe+TniRYG/yihNDbjGsl/VDO x/lwODKUhZj5ck65ROnzWX982FR9rhisJUh4vnapz89g6WUNE450fug6jAx8Ddt1VFVY zXtQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id s138si1351860wme.1.2021.11.14.09.28.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Nov 2021 09:28:16 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4HsfRh05lmz1qwdZ; Sun, 14 Nov 2021 18:28:16 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4HsfRh00Dxz1qqkB; Sun, 14 Nov 2021 18:28:15 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id wAK3BSQlCPWc; Sun, 14 Nov 2021 18:28:15 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sun, 14 Nov 2021 18:28:15 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id F257C45408E4; Sun, 14 Nov 2021 18:28:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z_W9SaV18qzc; Sun, 14 Nov 2021 18:28:12 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 07775454275A; Sun, 14 Nov 2021 18:27:46 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH V2 17/36] channel_curl: pass channel_data to headers callback Date: Sun, 14 Nov 2021 18:27:14 +0100 Message-Id: <20211114172733.71602-18-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211114172733.71602-1-sbabic@denx.de> References: <20211114172733.71602-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , 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 --- corelib/channel_curl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;