From patchwork Sat Oct 24 18:47:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1387089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::540; helo=mail-ed1-x540.google.com; envelope-from=swupdate+bncbcxploxj6ikrbthn2h6akgqekkhkgfq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=GzwME92Z; dkim-atps=neutral Received: from mail-ed1-x540.google.com (mail-ed1-x540.google.com [IPv6:2a00:1450:4864:20::540]) (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 ozlabs.org (Postfix) with ESMTPS id 4CJVTZ1w65z9sTf for ; Sun, 25 Oct 2020 05:47:43 +1100 (AEDT) Received: by mail-ed1-x540.google.com with SMTP id a73sf2289172edf.16 for ; Sat, 24 Oct 2020 11:47:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1603565260; cv=pass; d=google.com; s=arc-20160816; b=rvJWiBt1WHyTxgLP0O4LROCR7ErigxyYyP87R/yV5U4OwP4RgyIz/ferkAUQuG39G+ mfznPJuFNJjYaFxH4Lf8bOF4NNaqIBnsGfCu/Al0p3xdrScGgKh70ZIGVHlVv0UhsMOF lMrlag/wxsaLBnPmL43MhyfyyJNdpmyrfGprTiwsMAwyN9RdbRu8JXkqHnthL/AXBIZj Eh4bbk8sjOKOLnbZBTk4bJpS1BT3GtyB+MJxafT8tAQ5e7Z9TurQlJmF3E7ZhFz5iyjg 8/IzDtxzdRZxQdSzoogLlYDxQpB6ZHSv0zV/BdlHmNsz4TsJc+ULBq7dEGkSEXtxKpGJ /69A== 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=x/fT/VlU5odW9ejI/Tg/AbTYKipWNprE3WNoPASzE2I=; b=i7lQwlX4Iws22jf96bEyAOyyCz5exA/hluV9gGwuRU3wtvgpBIEhQfY5mWzNfzbbVN JOZSyfl0zl7CbeuRIV8TAtK1JMlI1lFGRUWqRSUcZUeU96LUgP7HMVrp2AwyfssbmSbN xdXPy/bv6Zp3YwqyoyCbY98g1ONqUpx/AsxZv4tXWDUm/1Vdi3DGlp84D3DlfFbpvaTL wQrRFtZz+gog1o1AsvofJtSp1EFdeRSnuG9QKXwXHNicxt74H0NWO1D7k3m8+PTIuacg yeo5A67waZwuRO7Qramcm5e2+qOQg+IKS1wyMoP37cPpN+viVaWO4S5hWKLqoKtALvyd GVBA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; 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=x/fT/VlU5odW9ejI/Tg/AbTYKipWNprE3WNoPASzE2I=; b=GzwME92ZyjEykEVS1Gp8BJpXXChP6UnbZkhJHaGZULHex2TAzKTOFwl33rNsCJQv0l 1/4AlVugIHff0BSTAhfsC647mGoBLhn/lnqJZrBQdkz2C1uktv1JOdqhXOX95aapfXml eXPVrJS3qtmbQIxeTvTzUXdyFhzPID8UNHZAxtsumzmax9OiF8SPuXtlnsBEYZ3kM84z r4quO5Fbc4jGBwDx+eUQ090NI21II6R0E2Sl2amRmDyhM6rgaN2xu1GI8dEsPhOFndMs 0EtTvInl6RVB9gg3otYAXVwL/QcRaNPvJktgfyum/llV8e2ZGGjA/LgFTXbm9fQDK3ZR sKoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=x/fT/VlU5odW9ejI/Tg/AbTYKipWNprE3WNoPASzE2I=; b=f/0jInc5gOiQyWdkrjmI2J4fsZzMHHCTgMEw0tv7qtTHBnp6/rH79/bYG3n2OWEhjO 2SpxWBVfStlJOc+dxDYx45rXERZjCfg55RwOyJu1+IoaYBbhqo3ueeIJ23VrXih7vKGE f0tTmZ92LavxJ3mx3v8k6aipDOovxblW/XJ0cEi7Zckp7uaN5feW5yCL8CWpAZBhUviL CrqcBIBUKyd29pV7gj62i7yh7W8lIhojH6CipJ1eUjUfk92PaYw75jBkIyRHLJEwGJ3x lqP4BlKtp00RfGmhHSG+03kW28scqp4n3iagFF254T6Hi7SFoHh0/8fkaEtFNjuLfjv7 J0mA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532+5yfBF+SYEOOzcLTSOjUWle9xyUOnx+5uuk9XxzOBempky8/p RcQHu8ykEF/bljlG42abzlk= X-Google-Smtp-Source: ABdhPJzLvtsFKuRzNATXryITkZCZeNiHS5PXFaDK7Jc0BNFLFjWDoCFb5Ny7phm0TcGHcrseWbOZOw== X-Received: by 2002:aa7:ca4d:: with SMTP id j13mr8086409edt.119.1603565260495; Sat, 24 Oct 2020 11:47:40 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a17:906:5208:: with SMTP id g8ls2483277ejm.11.gmail; Sat, 24 Oct 2020 11:47:39 -0700 (PDT) X-Received: by 2002:a17:906:a4b:: with SMTP id x11mr8223704ejf.11.1603565259497; Sat, 24 Oct 2020 11:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603565259; cv=none; d=google.com; s=arc-20160816; b=ALwpXfxhbNRwwGZtEioQWwiRB/3JN35SW1/opUCfHquFcWcvCwvedhCOV5t3T6q3LP GjvpbN+8qHdM15qOt8nCPNOjfL68fsk8kfZ5EJVQ4puIZCpPk/uWN6oMKMkLMTiJdR54 /bSandBzM/vgtfMDjTG+MTvtFde9Qsm7BDWEDPjySAZivIgkqHOzboZbCXCB0V9jpP1m zhRcm0mtTrbn10aCkG2gCAev3atF5q08W8GWugH3Lbu2YmnHBiJxGb8pyauF0B61QG3g 9hhejO0oPWq1NMA3GsxxZ1RybTjVi9ll+tbjP1Nj0+aS5vXyDWVpUfxaGJtfVB/+EQ4A e6Rg== 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=1+dCEqP4xxgKYjjLjciX3/pgNR93CBpcx4sDq+n8fkM=; b=kKx4b5i58D9gFvIi63idZzpmRdoxbhnFJEUIBe+AlVGqpGxwvIKVt5tIW12vVEInjM N/ldsI8sxezu97RX1fFyilBZUdljcTK6goWwHY6+/2IMKiiYOTws0JAHl0Yfdpf/hwa0 c0EB6hUJfXD5OWUFEsYVyjVsonN35i3GzUnoSIXFYwtDo2fMjJHgKYOxobD/pzgUoP14 GHwFObotT74NdQcfO/L4PunUxZIckVT8d8tXzJKKG35sCf3wh4GUGdRwYKrPI+c5NJpH 3cfS3ToRUdCrzes8nM2/sGYaRkBIMuKT8dBrM0wXC4Gi7lmYgIpj0+HbZzyTzQBPRaaS i6Iw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for 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.10]) by gmr-mx.google.com with ESMTPS id lf25si202899ejb.0.2020.10.24.11.47.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Oct 2020 11:47:39 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CJVTR2RPYz1rsMj; Sat, 24 Oct 2020 20:47:39 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CJVTR2Jr5z1qrDx; Sat, 24 Oct 2020 20:47:39 +0200 (CEST) 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 nrupQ744z7Ul; Sat, 24 Oct 2020 20:47:38 +0200 (CEST) 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; Sat, 24 Oct 2020 20:47:38 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 5FA58454067A; Sat, 24 Oct 2020 20:47:38 +0200 (CEST) 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 ZCJpnpjyiren; Sat, 24 Oct 2020 20:47:36 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id B7D4A4540720; Sat, 24 Oct 2020 20:47:33 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 3/5] Use swupdate_download_update in curl connections Date: Sat, 24 Oct 2020 20:47:28 +0200 Message-Id: <20201024184730.119506-3-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201024184730.119506-1-sbabic@denx.de> References: <20201024184730.119506-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.10 is neither permitted nor denied by best guess record for 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: , This is called to signal the amount of transferred data. Signed-off-by: Stefano Babic --- corelib/channel_curl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index a4e9a98..c95b6b3 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -23,6 +23,7 @@ #include "sslapi.h" #include "channel.h" #include "channel_curl.h" +#include "progress.h" #ifdef CONFIG_JSON #include #endif @@ -379,14 +380,7 @@ static int channel_callback_xferinfo(void *p, curl_off_t dltotal, curl_off_t dln return 0; } *last_percent = percent; - char *info; - if (asprintf(&info, - "{\"percent\": %d, \"msg\":\"Received %" CURL_FORMAT_CURL_OFF_T "B " - "of %" CURL_FORMAT_CURL_OFF_T "B\"}", - (int)percent, dlnow, dltotal) != ENOMEM_ASPRINTF) { - notify(PROGRESS, RECOVERY_NO_ERROR, TRACELEVEL, info); - free(info); - } + swupdate_download_update(percent, dltotal); return 0; }