From patchwork Tue Sep 19 16:07:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 815634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4010:c07::23a; helo=mail-lf0-x23a.google.com; envelope-from=swupdate+bncbaabbqmbqxhakgqe6jmorui@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="B8C46gb1"; dkim-atps=neutral Received: from mail-lf0-x23a.google.com (mail-lf0-x23a.google.com [IPv6:2a00:1450:4010:c07::23a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xxSSj2kMfz9s7h for ; Wed, 20 Sep 2017 02:07:32 +1000 (AEST) Received: by mail-lf0-x23a.google.com with SMTP id a138sf11910lfb.22 for ; Tue, 19 Sep 2017 09:07:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1505837250; cv=pass; d=google.com; s=arc-20160816; b=eqK2JdXUDHaD26hBr5tOCMVI3ORfj+BiCQ4nISsDb2BsSZ9c8zrNT48bdPfNfaQCTt 4AFrMY1MzX/UR9O58RETY3gODYLelYh3QtQ6W8B0hhBcTDdLkgBqBf91vpsCnesEcUF2 C5mE2ulE39VMvWGp/OQ0vAtuYNfaeIV1/p68V5sKJDbKkczo93yz1yqXEyEkdVSDDTTn ZEBxyrgIz8H4r8IF90xs2i57SBK4N+IWuAO2ZntJf2ILH73PpNsm1BYLpF2h+tQeNzzq IISaNM/CMYTDcjuXiiIEk5w4uR/GU5AlG3CC7ExKeRSmYIN6oH/lbhdwXHWYqzUT4tds wTHg== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:sender :dkim-signature:arc-authentication-results; bh=+JD+BG3pfX4PDCHqvCVpOUJzewU+R1+pHD0ILlIfKJc=; b=f7n+DfXfIGwqIz9s6DlWKYLwIU4Usr1GaLtL+hrqcM8l/Ecu17mHi2cOmz0iMoOn85 /IymM9xdJwaNTbx9RD3AHW9/IFMR3NZtt1SJ1uoHXt0mNDR9XekIvSIqmWowveljm754 2mUp0559FS6ZpWulax1i4IkH7VQRU+M4hRp8vz6a4TUkglAyhbqI37zETTqJrdsan2io MMmtvubrEJChqMsr6LxAijb6CHO9T6wov0Eg88rVivMiCDcMO36AZCzLBgBG8HQryDuI naGAEyymk3usvrRUquJKWiKoqnVYqI3LpIBZ9Z/6DLgoF+ZrV4oljx33ojlw0ozHpTvb XBpQ== 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:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=+JD+BG3pfX4PDCHqvCVpOUJzewU+R1+pHD0ILlIfKJc=; b=B8C46gb1Nz+wZdgqcb+gmEr7j+rjanhsRtBMGAVT+i0XVxNA8BsKZm9FvcESoqFues pLsOxcz23ay9a0T4z/dPxX1TCJXm2ZBELoJoDlHZ4ApemP1DBJGiUiylBN7E4yn2WZtC lLkFdNCU8Y8MWY1kI01VkOGZ+7iKdCm6LOcH+8EOiuZwb0e3ZG2uSIF3fXQ2u2z69foB NT4NU/Rig/ATlKfCJRYuSHUh11QcuYRg0Mne9On/QuMDWQ8eThnRzpDv01jdgQKmQ5xf 1KIAqf9yUDxiMxxm/iMAla/YK9Pt+ZyrSjR+1QrB5pn3tJ29PygfERgkuyRQtRX9fb+a dhOw== 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 :mime-version:content-transfer-encoding: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=+JD+BG3pfX4PDCHqvCVpOUJzewU+R1+pHD0ILlIfKJc=; b=F97f0FpMYHKy2B/MyPwryG0UWlmpqb0/gzu/KTQrz4vd2ot4oWqltevVt9S4tY99Nn oFFfnysIpYxBMvgmxwi32OEGQZYL7YkjKdJ1R6ZeGcAianpEs2ZpebUcSCX65NzzzcYO xxmpA7nx3FzMEwiDl1rYJRcx3dUUXVjS/3202/7V2MVZh4HFdOlBKTY9VS3Y/A6HprX4 LvubduPLU5ZHeGXOyMbS+Ka0Oa40IZ2eZuPgguArgBqaVhlZeBFGwUlN6pTHc72Ew3b3 1QLh8mRH1R1Vrq1cJBDkwx7816zZgvIOTqehm/VpIod3Hc+sfLubXp3g82N+CSK7Plwu cozA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AHPjjUgh6oO1N9xHUXbSp5TT/yrKGPmr3ZjGgA2/4wOCnf53orwL6HGv jBBhcnbyB3Qyh/N2B5pUzVc= X-Google-Smtp-Source: AOwi7QC9LX4kF50CnUMNOmU9QIb7gFk8dgT9OCm9rNmW5t/fqm7vpAqqXTlPGikBAH2egvRQ8ufwDg== X-Received: by 10.25.40.193 with SMTP id o184mr2927lfo.3.1505837250107; Tue, 19 Sep 2017 09:07:30 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 10.46.87.20 with SMTP id l20ls118247ljb.38.gmail; Tue, 19 Sep 2017 09:07:29 -0700 (PDT) X-Received: by 10.25.92.197 with SMTP id u66mr219365lfi.10.1505837249515; Tue, 19 Sep 2017 09:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505837249; cv=none; d=google.com; s=arc-20160816; b=S+l/3hfhq0MqUy1EU/+gG1Bi3ey5m62uCoopoi88m44uooJWj9Zm7uAK0D2f/QZxLl ABNedU8KDcfXwo19kaxS/dtMRZTxfMUAf6PnD1D1NWi+BUG9q4cyS/sn9XGKo3vGYApg zRPa1MCUeNTBi1SNX9KZTscS158vTzFO2PZqAK8LmvcTRSqYdc1festwB0krHZNsnvVC 47Z5U6IZ12+r+Yh7WN3+g41nF2ZqSRKT/3DK2LzdG4PGgfKc60JVoungKYZP+5iDKE/X QftWxVBH6XspOo0OX2ihoC4Zopr+neJChH2Txr+cVLPyM5Myjsz+qV5zwIUFYSQ3egF5 wjoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=nE6vscYe1WXlSlF/OLl7A9lb4hrNfbPbYVXGWz/C7gs=; b=MX/b2v8tdk3GS1npnx75LOYpE8KTpHee8tTXnQAS2RrGNe4vMNbIDF/bkizFy5pNwu h62zHV0AE4FF8VKKkDmW43kB97xdoGGIVxCnO0icinzhTB3c4w6qKej7KK+wHB4pRhvs DAypeF9ebuMZRNMSdquORItE+LeUaP5ChxPLKoszEtezsgBneF1t6LzzlMhescdxIHHH b4+qmu3RAiqgJG+NMC87soLTjXad6GpCsG4E8fgnyrYo6GTeJJaN83eppJGWt3Ay9CZn 2AKpNrvySg9eLRH8aqpIPDoVw5LEY7mj8+qQO1qfZeirjVmtBCOp7YEpcA7dhb12o4to a4eg== 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 d82si145200wmd.1.2017.09.19.09.07.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 09:07:29 -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 3xxSSd1nVpz1rLGX; Tue, 19 Sep 2017 18:07:29 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3xxSSd1bRGz1r0wX; Tue, 19 Sep 2017 18:07:29 +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 JLE2IeZQcJFg; Tue, 19 Sep 2017 18:07:28 +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; Tue, 19 Sep 2017 18:07:28 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 0414445406A6; Tue, 19 Sep 2017 18:07:28 +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 Eh36JbkzSff6; Tue, 19 Sep 2017 18:07:25 +0200 (CEST) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 007934540579; Tue, 19 Sep 2017 18:07:24 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] downloader: call postupdate after success Date: Tue, 19 Sep 2017 18:07:17 +0200 Message-Id: <1505837237-29305-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 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: , postupdate is not called by the downloader as it is done by suricatta and by the Webserver. Signed-off-by: Stefano Babic Reported-by: Florian Müller Reviewed-by: Christian Storm --- corelib/downloader.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/corelib/downloader.c b/corelib/downloader.c index b79d704..219a54c 100644 --- a/corelib/downloader.c +++ b/corelib/downloader.c @@ -380,8 +380,15 @@ int start_download(const char *fname, int argc, char *argv[]) for (attempt = 0;; attempt++) { result = download_from_url(options.url, options.retries, options.timeout); - if (result != FAILURE) + if (result != FAILURE) { + ipc_message msg; + if (ipc_postupdate(&msg) != 0) { + result = FAILURE; + } else { + result = msg.type == ACK ? result : FAILURE; + } break; + } if (options.retries > 0 && attempt >= options.retries) break;