From patchwork Mon Oct 26 14:03:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1387765 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::137; helo=mail-lf1-x137.google.com; envelope-from=swupdate+bncbcxploxj6ikrbuno3p6akgqejap3rlq@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=k5l+3G2P; dkim-atps=neutral Received: from mail-lf1-x137.google.com (mail-lf1-x137.google.com [IPv6:2a00:1450:4864:20::137]) (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 4CKc5K4k6bz9sV0 for ; Tue, 27 Oct 2020 01:04:05 +1100 (AEDT) Received: by mail-lf1-x137.google.com with SMTP id k6sf2328942lfg.1 for ; Mon, 26 Oct 2020 07:04:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1603721042; cv=pass; d=google.com; s=arc-20160816; b=CIYd0Ec4GxH9CVP95MyXmB3StqY7wYOojmP8E5GDeYg+bgyr95jt7fgSzOp9FqbJB2 XIA3uflXKjBfjyQIcDW2uN10b1T45Md9L1mXAoS0DiczHmHQYXYvWIJ9//Xc75sll/Uy L2AdKcej8jYYFA0v3o7ggOPhoxeZJUf5/ScoCXMvO01xrJYtCONeJG22n+j+uRoNlamr lWnsJ+a2pkwnTYBfpIZ1LVqFsNixEa5zo2FFVgWA6SDJ3z8z2uJuE5csymK0w0+DRd8v HZAU28FzEJyQSq24MtsG0cFkz+fytAE61rcdXxyk14sBtpgH9OumSQvETnKJreu9PpqG Ew/g== 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=4wJ0hgv29VqG09Jf9+ImKA98MfaXOPH6kYAKTVbICKo=; b=ThyMxqq3j3STQJWww16CwDvWVaqhYKRPu3YRJ3cG+JJ7cq01TMCmN2i1Rh+dBjdKHl llluhJHpCZKX07fNXiJ/zqX1CAKDvgBAJQR/Dc6yVVtmDBlEuX3MzaHHAi/+xLPiohUG Aclo/IdWWPYYkScaj3mpH6fHU1TbNbyzrvCM00MVHMRVnnUcTeBG0teSRCNbVHP8siXs EgFDGwp7pCEj0ZLw6dqK/Xdvke862/KsEZBkwwtUxYgSAe/QI3DlzpXyZabFAQyVmHwX 5wGryYfx+1IqYgC8jny+teWJHyj5BK0OVob8Gv1NgS9e+EF5dSbJ8JPNBB5vd/iV8hIq QxCQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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=4wJ0hgv29VqG09Jf9+ImKA98MfaXOPH6kYAKTVbICKo=; b=k5l+3G2PRTIEVHv9ddn/6GLRqlEUD4qALW5UFIqgWDCgYhCYbrgGDbeO4BoBH5kE/j q6qWaachIdeHFnGnl+NUxKKGrZAK9dN+LgOz7Xq2UKEK32ce5o6ZZgjA5gG/1zrnUanh krU/lqgeS2OJLuZzR97I5kZn7Jhc0ArY5Gl0bAfMvaCe9/AP58lD/rvth0mNJvVKR0ft QEIlZ/HRCOLZAvLmkAHtruXjzHv1u6VguOaJdfeFw8Pq0KYW3mLeQP87I9ajUxQYZzyO /pE253wcTIMwq9j4SVceuEXWA29PX0wckjRew8T4VW0BAFCHffDBNRjnsekHteirTUAz trkA== 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=4wJ0hgv29VqG09Jf9+ImKA98MfaXOPH6kYAKTVbICKo=; b=njmAmd60kWPsPH2z33HcJzmnSngH60d8hCgQ/g7lNkba2FtjAgJ3HiT3TtiRu7HeMN bNEiURvQs57Y9Q2ilqeBC+lgPr6fD6PuHh7fo+HbBcB5YYRCaldF0XemJTnbEK7lcr3j d8Xb73cg2hXAZ6M5X1x+kdxgsGLtXJH+5tPGgeqMA8cGhD1o6rWUPEOnFfQEpKECT6mW ZrelhU07Y9d6riOhJEpeocGnCSWOvnRsXJ1UMGOIPS5KqvfTpOjVSOrAoZ8P+yhG8rAt fwh4A4qJ8NwoQVS2kuVFCUJ8sQXbREDR7np1QZYOlD/77Si47dGxzFMESD/gJcy1HjF5 Mj2Q== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530fqnhRqOnc0SxairXweTh8ar+deGaamBmsP12n8YLDdNZHFxNx 1981H7AG4oYeC48L7pvTEeM= X-Google-Smtp-Source: ABdhPJy9eLe+Si8AjfWhjKggBEUWSbKy5L6PSxRw1QjXvZSl+trFrbaIZhFXWDE6TRA5EZpk9t9SzQ== X-Received: by 2002:ac2:43b0:: with SMTP id t16mr5517676lfl.95.1603721041995; Mon, 26 Oct 2020 07:04:01 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:9bc1:: with SMTP id w1ls1461632ljj.4.gmail; Mon, 26 Oct 2020 07:04:00 -0700 (PDT) X-Received: by 2002:a2e:7e03:: with SMTP id z3mr6198917ljc.270.1603721040787; Mon, 26 Oct 2020 07:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603721040; cv=none; d=google.com; s=arc-20160816; b=f+IRe/wvL0XkXtVBMZSAEZ9X2Mj5UoCqVVJAkJQEaxLUdhBijYwyinVnc1BTLgNh7+ VCOmv+BlMmyBm08fnzJh2HNpMQN5y2v4U+LuPqZ22xs1LrIGeiJuKuHwhhmf4p/PiLn2 wTOuDgeT+mTcsxWAE/3a9CE/a3qk08oY3Ehs55z8MV/zapH9tH5ejEDoIXXmrhaPfnU6 /dimH9y6XaDeNwNegF0hIpHnwYblpb9C229V8OQX/gi8Bph6U7zQkFT6ScHj1mpQyXmh zGPF7Nt6lxaVf6sPvrAi+PL1sH6UOXE7+WTkAz/XRKtuna662gKIkmqXMawHYA+siCuY 55lQ== 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=aH4jdnckMyQJUagKfHPxHEiQJwOGy27/UtNkFQv1UXi6jHi8yKT1+k9CdZpPatlnLC kDumXIzM8VLBA39COH75ZVDwwAFoK5YKQggBoQjBJR4q/Ad9RJqENmAU5TuctMAHdRTb PNDycuUT+Y42V0XdHZZx/oGx9Bv7jDAI5KhnIjdu0mM+rC3MUXbM9kP8e0duDVxxB3YY zIG9RGgFngCwYBUOgtQ0hyyuo3AOnEEjUENJRNLwwiBf9onxYNZWtpxVbxOXr0jNz6mi HBSgcOxomzf8BI5t9d4BXW6gn0q9t/P5c+zSzvABbFk27LtEgEHkBC0TjPBu4WQ/ePQe NqrA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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.9]) by gmr-mx.google.com with ESMTPS id r22si253467lfe.0.2020.10.26.07.04.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2020 07:04:00 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for 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 4CKc5D27kYz1qt40; Mon, 26 Oct 2020 15:04:00 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CKc5D1qTMz1qsXC; Mon, 26 Oct 2020 15:04:00 +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 JriskBpB5Rnk; Mon, 26 Oct 2020 15:03:59 +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; Mon, 26 Oct 2020 15:03:59 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 1F4A1454071D; Mon, 26 Oct 2020 15:03:58 +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 tu7Ze7PI-a5m; Mon, 26 Oct 2020 15:03:51 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 1F15B45408B9; Mon, 26 Oct 2020 15:03:45 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [Patch V2 5/7] Use swupdate_download_update in curl connections Date: Mon, 26 Oct 2020 15:03:40 +0100 Message-Id: <20201026140342.147578-5-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026140342.147578-1-sbabic@denx.de> References: <20201026140342.147578-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 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; }