From patchwork Tue Oct 8 12:48:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "fhoerni.opensource" X-Patchwork-Id: 1994236 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=TCIa469s; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::103d; helo=mail-pj1-x103d.google.com; envelope-from=swupdate+bncbclmhafq4qcrbd6uss4amgqe3zcgcly@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-pj1-x103d.google.com (mail-pj1-x103d.google.com [IPv6:2607:f8b0:4864:20::103d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XNG5v1snsz1xvB for ; Tue, 8 Oct 2024 23:48:19 +1100 (AEDT) Received: by mail-pj1-x103d.google.com with SMTP id 98e67ed59e1d1-2e148d4550bsf5453794a91.1 for ; Tue, 08 Oct 2024 05:48:19 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1728391696; cv=pass; d=google.com; s=arc-20240605; b=LXhO5FexEJCNS86/pa0AnK9rYUbaeXMBzZWOG8CKgK2fs3RC2bGlS0J8UpGZzFFIHA DmYsVyKsfJ+AF8BVGtXVs+uYgErFPLSx7MhLW4SaySjxrha+gRLCBdxR400x+XiHwjmO MPM7M4Q85/5hERp70vr0CFiJS90Hf6Bgi8PyyChDVWXUTzRN0S8CLnyrLEmPc1seeNaH fvIoPdluPYKsiFKghUHdhoQWgWduRZ01uFE7P2lRCZdb4Nm8hNC+QStoa6ib4Q0hemVF 5qUqT05pczsM8Q0G3Xyqny1bXznhl7z8XGe1QlPQOZbXjLo2iRmmo1Uw8Hm8pzhWUyjw RdMQ== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:in-reply-to :organization:from:content-language:references:to:subject:user-agent :date:message-id:dkim-signature; bh=XO5zxcKA1g65+oWpOeh70B3Ve8pLiHY0DLBJ0qfXjmg=; fh=6LMNKYWrZgKiqEdj0vN1a/m8IftVYs2KStMnXOkUCIk=; b=C0YZY3+RlF6b9LtlULFmYtYCCDr1KslLABXmzAv8zuh/zC6cYKXOTmwGVGpJRPjQ3n UCOyeOtMvvd27b+mNYYxTHSeYO7QnyoQbsU9W7+KcgIVWtfSUzaB8ilelf2uu5ihjIkx wMaWN0Z7L52PFU7KSWZkD81y+UxDBb9FJ6kMIk5bbIfCR81VofxRTEwL6omHQEy6oEAe XJH2Lr38zOFQEkLK4n/oiZraQt+M+WlN3yeTvRD7fNLcrDJH+Oc5N3LjdZ81ujEBqQ5D gBHQln9uHfmuepnhLRicW/Rl/hfNcLZdHj9ogAz8E/lRPiQ4sYE9HIMa1qoE5yNzv6Jy xsKg==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=KWNlnNs0; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:260c::713 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1728391696; x=1728996496; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :in-reply-to:organization:from:content-language:references:to :subject:user-agent:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=XO5zxcKA1g65+oWpOeh70B3Ve8pLiHY0DLBJ0qfXjmg=; b=TCIa469suuS1OwigGuTqxmoZqS+nHdMr9k7p97BhaYT2A1fzmbX0HfX5YXB4Fw7AWk ZVLFoZpIwkg4eMi5BOZpy5rKRUsOv45ETOW8dioNFT0/WG5ap3lHPGm1cwmPb8RPJYdV itDFvn3s7iClHNq7G3NoCXwQ3Xiy+T0/oir+hvEYd48wSc+EcPbxe5nbo8yWWZGAXoRC KGvabgHuPdbP88GidMkYPorUVACbDc97na1U/RQSANYu3BRbxKK5e5FSLKlB4RgWS68Q QZNA3YUZYUumIcRoxl7aadCD5hraDra/TvHSWgbGXO1VpzI4hwjZR7xTwRfq+Chg5xp0 17lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728391696; x=1728996496; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :in-reply-to:organization:from:content-language:references:to :subject:user-agent:date:message-id:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XO5zxcKA1g65+oWpOeh70B3Ve8pLiHY0DLBJ0qfXjmg=; b=iuC/ppiRtxruVsOklC6y9+idEVGUydqXnb4fPEcjxqh0fqIiY5Fu4UDD2RhVAfh8Rt oFklp5KHCuZKir4gMI+DRa7dRkgsS3WL19d1idbsgBWf3CzTGVrJ5d1UkYmLG7GuVk/V fgjNaNjQgpr+R/qw624vtx/7jebKBT6pkgQ3Jg1XXAlg4XrT9z9RQ+J0sN5rgrUGT8sN Q1ttvJ7XUHlDC7qdzKmAPy79tLMIyWFTMCtw8wH+wje49cUll49/oB5wzWjd49TWIf5T X1GMy2Ti1WYXVu3q9752nq8x3iyO/HmWQw8vplWCEvQa2W7uGqAKCs6ouZUFK9FqA/iB E+kg== X-Forwarded-Encrypted: i=3; AJvYcCVK3dahkjq9ZpWEMmsF4/0Bb43xDUvL311rO1fG5HmallXAV/580h4GxnxusrfNaXinDW7zdADPrQ==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0YxkXQKU29QgepJmHTA5GSmdPPzGJkuOj1IPEMO4ES69POY3wtrQ i6RIK46h+1bQ2HtHpzcA1d8l9Lwy0uXaB0EMj3QrBWoLzS+2dfR4 X-Google-Smtp-Source: AGHT+IFVNSUkRQq4IJpy3VqNm4XMSadTjaFAIu1QLxCScbKc+elqRqPgCILzMGC4Rv/41lmBncGNrQ== X-Received: by 2002:a17:90a:c242:b0:2d8:f11e:f7e with SMTP id 98e67ed59e1d1-2e1e6221a7emr16995962a91.12.1728391696254; Tue, 08 Oct 2024 05:48:16 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a17:90a:a888:b0:2e0:79a0:bd97 with SMTP id 98e67ed59e1d1-2e1b36a332bls3620574a91.0.-pod-prod-01-us; Tue, 08 Oct 2024 05:48:14 -0700 (PDT) X-Received: by 2002:a17:90b:3806:b0:2e0:80e8:a31a with SMTP id 98e67ed59e1d1-2e1e636f5c3mr16048677a91.35.1728391694572; Tue, 08 Oct 2024 05:48:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728391694; cv=pass; d=google.com; s=arc-20240605; b=bmIWXSEUSm0hq517L7nrFmED5n0YULba3QWHkU5u2asP8yFigNd3SdegcdixjiHir3 Z0/uGosN5SaK8U1QDe4so+1VuIWHGbtMSPlvaJEsOHd6frJA+c5n/+1TrQmhiEJxJLTD w+01AUEBTYIWA0TnlV/EYPmzpLZVcixc4nuCWJdBgZ2X55U++wRkxtGivs2TaGBdXX/e hSvvuOD6A2okSDoqXokzwUjOwceRPWUkQAyi7lPyNOnbht+1GG6vN6vL55Zx+V7VnuQE Uz2FE4dCcxfOXX0VoOAFHHpT6J1ygcZyjGbIJ6qgLRAPSttz91CklPDF975alq6WLhul g+XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:content-transfer-encoding:in-reply-to:organization :from:content-language:references:to:subject:user-agent:date :message-id:dkim-signature; bh=mFFL8TcPsqW/R7mMlSjv7LwNaM4/MFkrwIUYt60/pUw=; fh=ZnR/GV7fAozRX3tpIO3vp/Jbul8ISZhdVjghlw9eWq0=; b=EiI/IjuD7yFlhl0vDTftnk2spR2+s5y+X2zUzhBu2VpuC0Eb9aPeAF2HXlZUtAaQ7v +VseFmK8cwWmvbF3IkMlw5CSsWx1QdHmrfadixyN+gOJeibqvhdufTATRXWlH0b31hnx hapgoWUfpyh7cQEMkSL4RkY8NPPwJ5KFIf/1R8tX4isNyEqMHHjqQ0sYAY2OGoEErZVm AkH6VdGvh2g0PS65u8cRYxiV2iGqLpgnpHAzhdgnFGBV4sejn0/pFTA/OzH3uX1qqGLn lJ5gMfXpuNmqo4N9rrKFj0Qv4fTZSyd2zaMEHf7d4tPkxgOo+giSZQbBoMWFmRRZbSzF YvsQ==; dara=google.com ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=KWNlnNs0; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:260c::713 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on20713.outbound.protection.outlook.com. [2a01:111:f403:260c::713]) by gmr-mx.google.com with ESMTPS id 98e67ed59e1d1-2e1e83ca39fsi363066a91.1.2024.10.08.05.48.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2024 05:48:14 -0700 (PDT) Received-SPF: pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:260c::713 as permitted sender) client-ip=2a01:111:f403:260c::713; ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ha8NgWZq1T6NTNWzn9+503EwDgL/RiA0/wpq9JHZqWugKR5b5ZVAeHF3JbrcFg3wSXqBYRQjUTPn3KH9pIAgTOFcSUZul5NnshHKtKwkN0cXte3dmP3hCvrESlE9OLXrABh9sMYk43W2TpMTtFSs6o4mnYqqmDhKO+QVl92TM6qdfjEocIqZl6ha6P+Ubo8eD/Z1A6kn4HU6HWReRWrioXpzhEb3gz1Rb76VL6FmRFEEu0cf89EfYYOlWHuY13nBYLFSI3m3qLTv7sEgsGZkWUjcgf8NSZHSDWmvlvnzTGQdt6I/RILtKnGuqEDv9xn6feQWy52dKZXdAIo5dioecw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mFFL8TcPsqW/R7mMlSjv7LwNaM4/MFkrwIUYt60/pUw=; b=Fa6TGrWbOQV7ttEs4/1CWhK6avYLYu0yxbp5GkxIRGNTOtyPNBOTJcizTeSaMkGC22gKpnrJ6Ahhf8yMEYxN5bFzBoj09GFFCPqalwZhxnDA4zaguqdvJWXJ5jIBuLQn5EU2TiOnNLegnXGf7QdwMyCi3yu1myOkFhZEEDZZdtYq1r24nu+unLqU+1o1Xaece01MeWwlR4SpHhu/qBWoT7wKPKkHjDnR/SjEJCrezAhrUoc5A/Yq/s3ezFaMkAYomYIjDsGafxSMf9rTJ0cJr49yxsII3kRfXgQRbLJz+m9EpZyZtuhr1YBvYVAinoJ7JNIP4jtl/SUVZo7YP5tQZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=witekio.com; dmarc=pass action=none header.from=witekio.com; dkim=pass header.d=witekio.com; arc=none Received: from PAWP192MB2225.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:359::22) by DU0P192MB1498.EURP192.PROD.OUTLOOK.COM (2603:10a6:10:346::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20; Tue, 8 Oct 2024 12:48:10 +0000 Received: from PAWP192MB2225.EURP192.PROD.OUTLOOK.COM ([fe80::8a5a:c9f5:c976:7b14]) by PAWP192MB2225.EURP192.PROD.OUTLOOK.COM ([fe80::8a5a:c9f5:c976:7b14%3]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 12:48:10 +0000 Message-ID: <11522297-c793-4c7a-8a90-214a82f3a97b@witekio.com> Date: Tue, 8 Oct 2024 14:48:09 +0200 User-Agent: Mozilla Thunderbird Subject: [swupdate] [PATCH 1/3] progress: acknowledge client registration To: swupdate References: <20241008123845.32785-1-fhoerni@free.fr> <97f79916-508f-41e4-893f-ef575c135c8c@witekio.com> Content-Language: en-US X-Patchwork-Original-From: "'Frederic Hoerni' via swupdate" From: "fhoerni.opensource" Organization: Witekio In-Reply-To: <97f79916-508f-41e4-893f-ef575c135c8c@witekio.com> X-ClientProxiedBy: PR1P264CA0138.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:2ce::17) To PAWP192MB2225.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:359::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAWP192MB2225:EE_|DU0P192MB1498:EE_ X-MS-Office365-Filtering-Correlation-Id: 4aba88c4-cbeb-4124-6ad8-08dce7977716 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =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htYIGl5sNLwxjRUrQgGjUPjGpFksk4620UwAbRb?= =?utf-8?q?pxeelDOi7JWD5gOgm4nZaTuFK3CkmW5Sqi6Uj6aJ9/jeFYSBojZUm2vQN1cJczO+U?= =?utf-8?q?EMcaactwWlhRpGM5NFhA+n0mKTtZHQ29fcrxhVfiNV+n1hG7n7rZk7H9YMuXsbPcK?= =?utf-8?q?nCqSw9aQKOmUl6mqCwc7NSoI8/Mn4jy0/pcY8S98YZfyIAgFjjG6VhfHpFOlWcFTT?= =?utf-8?q?XxFJBbTklG99lw8VxPFh9Gr42NRLtNYEgVHLtZKmjOlQ4ixlBM2yB5+02SZAkTDte?= =?utf-8?q?t7+2EskIBWa/YoDE2osOcirJBe/NaQkjBrE1jLZV6zC5BtEw14N+yIaOiPaKETuq+?= =?utf-8?q?ZEWyXRHdZ7mWhBG2JOPtXlH01Xa7/03qvKtQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWP192MB2225.EURP192.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?V3BiwVqFhVHmzf7bX4iBcq88Lw0L?= =?utf-8?q?8ma3+g8HaCoOSoX56t4ATTDdoEpGSQB5K+0YbBJ356OBX/u8pidR/a6XLApy1DHDs?= =?utf-8?q?h36ne9JbZkxF0EEqOeVXcnBCNSYhum413++bC6rS91AdhgkI7ySI1VHxHuUAUKjlL?= =?utf-8?q?niXNBUwiZ5iUucmWtEJlhtB1FyAg+VnuVUsPUM1IvjC9B2c2nC/6xv900OOi7vuDU?= =?utf-8?q?3PrkoSxinigpMi+HbPDH7QnEO/0SmD2LgWku5uACpRm/wGiS5tbpkCYmcyavQuYJ+?= =?utf-8?q?zf8gGLJBCoLTqJbKCSk7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N8IkuQ5Q9JKQj18G2WB7ufTBCozGW2v?= =?utf-8?q?ukUSZ0VlyvOmN2Nr9EGOrtvA1Sj2UqtI6kjhArHI5vt6ApJbjE7gAm3Wm2TgDFP/K?= =?utf-8?q?lvoV8fNsivP2TRLNyVop1wFIl8deUIPGNvaU1eEyyGclE4SlbVFoMOkGcBr82SbkZ?= =?utf-8?q?sOG4xV13CRGkeGoj0blvjTZTaOQQyxUdsIZ4lxygT6Eau6VsRiQXn8qjtjx5AuIbC?= =?utf-8?q?3awt2KSEDTfTE+O/j3TrEtU34lSM3izj9dAS9+m0pgCRJ0+VAYNXhTqMGGdZETc3Q?= =?utf-8?q?MC1qYGBlfNoKPYJiZeLMOnyoLWvvbCNBwRa6H5ej6KyWux5/Kn/iNbAV5cIyXhTCK?= =?utf-8?q?ltbGgziF52ug?= X-OriginatorOrg: witekio.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4aba88c4-cbeb-4124-6ad8-08dce7977716 X-MS-Exchange-CrossTenant-AuthSource: PAWP192MB2225.EURP192.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 12:48:10.4930 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 317e086a-301a-49af-9ea4-48a1c458b903 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UmHj0PNPcWkc3ZedwYzM3R18IavybAyuj5O9CY6pE8xoACG4p3SFVbM/Y6MPJ1UTOr8wlB7BquKBeyHANdWwNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0P192MB1498 X-Original-Sender: fhoerni.opensource@witekio.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=KWNlnNs0; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:260c::713 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com X-Original-From: Frederic Hoerni Reply-To: Frederic Hoerni 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: , From: Frederic Hoerni The client that connected to the progress socket had no clear confirmation that the daemon was ready to send progress events. This patch makes the daemon send an acknowledgement when the subscription is duly registered. On the client side, the function progress_ipc_connect() waits for the acknowledgement before returning. Signed-off-by: Frederic Hoerni --- core/progress_thread.c | 18 +++++++ include/progress_ipc.h | 13 ++++- ipc/progress_ipc.c | 120 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 149 insertions(+), 2 deletions(-) diff --git a/core/progress_thread.c b/core/progress_thread.c index e17d931c..8d700db6 100644 --- a/core/progress_thread.c +++ b/core/progress_thread.c @@ -253,6 +253,22 @@ void swupdate_progress_done(const char *info) pthread_mutex_unlock(&pprog->lock); } +static void progress_send_connect_ack(int connfd) +{ + int n; + struct progress_connect_ack ack; + memset(&ack, 0, sizeof(ack)); + ack.apiversion = PROGRESS_API_VERSION; + strncpy(ack.magic, PROGRESS_CONNECT_ACK_MAGIC, strlen(PROGRESS_CONNECT_ACK_MAGIC)); + do { + n = send(connfd, &ack, sizeof(ack), MSG_NOSIGNAL | MSG_DONTWAIT); + } while (n == -1 && errno == EINTR); + + if (n != sizeof(ack)) { + fprintf(stderr, "progress_send_connect_ack error: n=%d, errno=%d\n", n, errno); + } +} + void *progress_bar_thread (void __attribute__ ((__unused__)) *data) { int listen, connfd; @@ -297,6 +313,8 @@ void *progress_bar_thread (void __attribute__ ((__unused__)) *data) conn->sockfd = connfd; pthread_mutex_lock(&pprog->lock); SIMPLEQ_INSERT_TAIL(&pprog->conns, conn, next); + /* Send an ACK to the client to indicate that it is duly registered */ + progress_send_connect_ack(connfd); pthread_mutex_unlock(&pprog->lock); } while(1); } diff --git a/include/progress_ipc.h b/include/progress_ipc.h index f0b4b816..e79d476d 100644 --- a/include/progress_ipc.h +++ b/include/progress_ipc.h @@ -38,13 +38,18 @@ extern char* SOCKET_PROGRESS_PATH; * - changes in major mean an incompatibility and clients do not work anymore */ -#define PROGRESS_API_MAJOR 1 +#define PROGRESS_API_MAJOR 2 #define PROGRESS_API_MINOR 0 #define PROGRESS_API_PATCH 0 #define PROGRESS_API_VERSION ((PROGRESS_API_MAJOR & 0xFFFF) << 16 | \ (PROGRESS_API_MINOR & 0xFF) << 8 | \ (PROGRESS_API_PATCH & 0xFF)) + +inline int progress_is_major_version_compatible(int other_version) +{ + return PROGRESS_API_MAJOR == ((other_version >> 16) & 0xFFFF); +} /* * Message sent via progress socket. * Data is sent in LE if required. @@ -64,6 +69,12 @@ struct progress_msg { char info[PRINFOSIZE]; /* additional information about install */ }; +#define PROGRESS_CONNECT_ACK_MAGIC "ACK" +struct progress_connect_ack { + unsigned int apiversion; /* API Version for compatibility check */ + char magic[4]; /* null-terminated string */ +}; + char *get_prog_socket(void); /* Standard function to connect to progress interface */ diff --git a/ipc/progress_ipc.c b/ipc/progress_ipc.c index c5ac9b95..815e1601 100644 --- a/ipc/progress_ipc.c +++ b/ipc/progress_ipc.c @@ -8,12 +8,13 @@ #include #include #include +#include #include #include #include +#include #include #include - #include #ifdef CONFIG_SOCKET_PROGRESS_PATH @@ -40,10 +41,120 @@ char *get_prog_socket(void) { return SOCKET_PROGRESS_PATH; } +/* Decrease timeout depending on elapsed time */ +static int update_timeout(const struct timespec *initial_time, int *timeout_ms) +{ + struct timespec current_time; + int diff_timeout_ms; + struct timespec elapsed; + int err = clock_gettime(CLOCK_MONOTONIC, ¤t_time); + if (err) { + perror("progress_ipc_recv_ack: clock_gettime"); + return -1; + } + elapsed.tv_sec = current_time.tv_sec - initial_time->tv_sec; + elapsed.tv_nsec = current_time.tv_nsec - initial_time->tv_nsec; + + diff_timeout_ms = *timeout_ms - (elapsed.tv_sec*1000 + elapsed.tv_nsec/1E6); + + *timeout_ms = diff_timeout_ms; + return 0; +} + +static int progress_ipc_recv_ack(int fd, struct progress_connect_ack *ack) +{ + struct timespec initial_time; + int err; + int timeout_ms = 5000; /* 5 s should be enough in most cases as the socket is local */ + err = clock_gettime(CLOCK_MONOTONIC, &initial_time); + if (err) { + perror("progress_ipc_recv_ack: clock_gettime"); + return -1; + } + + unsigned int size_to_read = sizeof(struct progress_connect_ack); + unsigned int offset = 0; + + while (size_to_read > 0) { + int err_poll; + struct pollfd pfds[1]; + pfds[0].fd = fd; + pfds[0].events = POLLIN; + do { + err_poll = poll(pfds, 1, timeout_ms); + int err_update_timeout = update_timeout(&initial_time, &timeout_ms); + if (err_update_timeout) return -1; + } while (err_poll < 0 && errno == EINTR); + + if (err_poll == -1) { + fprintf(stderr, "progress_ipc_receive_nb: poll error\n"); + break; + } else if (err_poll == 0) { + /* Timeout */ + fprintf(stderr, "progress_ipc_wait_for_ack error: timeout\n"); + break; + } else if (pfds[0].revents & POLLHUP) { + /* The peer closed its end of the channel */ + /* (note that some operating systems also set POLLIN in this case) */ + fprintf(stderr, "progress_ipc_wait_for_ack error: peer closed\n"); + break; + } else if (pfds[0].revents & POLLIN) { + /* There is a message to read */ + int n = read(fd, (void*)ack + offset, size_to_read); + if (n == -1 && errno == EINTR) { + continue; /* redo poll() and timeout management */ + } else if (n <= 0) { + /* read error, as at least 1 byte should be pending */ + fprintf(stderr, "progress_ipc_recv_ack: read error: n=%d, errno=%d\n", n, errno); + break; + } + size_to_read -= n; + offset += n; + + } else { + /* unexpected error */ + fprintf(stderr, "poll returned %d with revents=0x%x\n", err_poll, pfds[0].revents); + } + } + if (size_to_read == 0) { + /* The expected number of bytes was received */ + return 0; + } else { + return -1; + } +} + +/* Wait for the daemon to send an ACK + * + * Returns: + * -1 error (timeout, peer closed, invalid ACK, ...) + * 0 success + */ +static int progress_ipc_wait_for_ack(int fd) +{ + struct progress_connect_ack ack; + int err = progress_ipc_recv_ack(fd, &ack); + if (err) { + return -1; + } + if (! progress_is_major_version_compatible(ack.apiversion)) { + fprintf(stderr, "progress_ipc_wait_for_ack: recv incompatible version: %x\n", + ack.apiversion); + return -1; + } + if (0 != strcmp(ack.magic, PROGRESS_CONNECT_ACK_MAGIC)) { + fprintf(stderr, "progress_ipc_wait_for_ack: recv invalid magic: %s (expected %s)\n", + ack.magic, PROGRESS_CONNECT_ACK_MAGIC); + return -1; + } + return 0; +} + static int _progress_ipc_connect(const char *socketpath, bool reconnect) { struct sockaddr_un servaddr; int fd = socket(AF_LOCAL, SOCK_STREAM, 0); + int ret; bzero(&servaddr, sizeof(servaddr)); servaddr.sun_family = AF_LOCAL; strncpy(servaddr.sun_path, socketpath, sizeof(servaddr.sun_path) - 1); @@ -67,6 +178,13 @@ static int _progress_ipc_connect(const char *socketpath, bool reconnect) usleep(10000); } while (true); + /* Connected. Wait for ACK */ + ret = progress_ipc_wait_for_ack(fd); + if (ret == -1) { + close(fd); + return -1; + } + return fd; } From patchwork Tue Oct 8 12:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "fhoerni.opensource" X-Patchwork-Id: 1994237 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=njMNFPFU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::138; helo=mail-il1-x138.google.com; envelope-from=swupdate+bncbclmhafq4qcrbt6uss4amgqelzsucbq@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-il1-x138.google.com (mail-il1-x138.google.com [IPv6:2607:f8b0:4864:20::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XNG7H25xMz1xvB for ; Tue, 8 Oct 2024 23:49:31 +1100 (AEDT) Received: by mail-il1-x138.google.com with SMTP id e9e14a558f8ab-3a392e9a8a4sf3313945ab.3 for ; Tue, 08 Oct 2024 05:49:30 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1728391760; cv=pass; d=google.com; s=arc-20240605; b=Yn+rhEb0yKYVfd+PYQiaiA0QVGVVqR5FvX0QM0iRPfeZkN81mNhwVhSnXJrO0j15pz /UhnhjRQa9F0FspFUMOexssTB5wEiUEGqWxJsnsO5YvrBFsEN3GDIHg9FDc6+Qo78pXY LE842PBAwNyYtKbI0oOzCHxVWVVZeOSxaRNYDF4JlO8VonhAXWuiTPyVvUQvSBLrYJtW iOSuxEB7jZx6iGxH5x8L7ll0CXh2BzxfzEbJT8WwAPnqsxMx53gdqMtn+HL8Fe5iWsV5 mIgutXNn8NiRqMH8sg+foqUEY1jr7K0X+AInwJK/C5qdcxc+UIghcG27O2rKxHgTpcdy OJaA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:in-reply-to :organization:from:content-language:references:to:subject:user-agent :date:message-id:dkim-signature; bh=m0lz/ND0f5CK0rON09mXObmHx4JoP1J5bNpGeBTtwTI=; fh=sYgGFzcDHHtRSgYyzp2a4IVlBF2nVf4rgqk1LqJc+0E=; b=NkZ7u565pXRZT5c/jd0X4w56jNb1CJWdOAh57ZR/bqSmBlFXpqZNpXZQ7DvH1L36G2 9AwPTYK/KLqXbidgjsC0XTZT5LvPZ4AdKZI7XmTl3bdfzxjWwJD8tN5Vn58ifok9Pl51 ZHRtojFvBCPYXABjLo6OVndeTeykqWVPM3gaghHO8Z0DKSM1npKQdB3UPcLwJD5jd7ux xCV9oxDFi7NzMSJ/64nkFX76cnpGT3P2gZbpFzEj6EnZhvfiIoUCkGBvbTbIHOU2xwYz bLbsFuDlSqPcXpbHFd8nZH/BJXFoKdk8V+NosOvTAPhLpszioQVl+YXFTtitveS347EB OuHA==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=K4gYBL2p; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2614::700 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1728391760; x=1728996560; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :in-reply-to:organization:from:content-language:references:to :subject:user-agent:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=m0lz/ND0f5CK0rON09mXObmHx4JoP1J5bNpGeBTtwTI=; b=njMNFPFUGAN7rMNZd/9aWnPqHHHAmU+QZ08ZD2bBdZCdGT2t9LjGW3MNm+aGdk8KJr 9jCrNG7Xjm0tGt7T8CtX8r1ATWmOEEi6b/HTu8au+/aAcqYncqtNWXVDcVCCnceCFGsK eOI8LXhjnQOm0ZYitYhxxFq1Vu05ULkAfmua6tdhRzZchHCwqrSDmSEcGcWYUrT6sN1U BQx849h7OnvmuxpBHwWoqttHkHT4FYh1f+sKOmGxp8/Z9WrqF77mDtx1zuC87ptsNI7P lcltuCgENJgVJ7bQi1w475Vb0IwWkrTOuQnFB1A3FTUFgg4lMBcILG1Gpn+lmDBKzQdG 0z7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728391760; x=1728996560; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :in-reply-to:organization:from:content-language:references:to :subject:user-agent:date:message-id:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=m0lz/ND0f5CK0rON09mXObmHx4JoP1J5bNpGeBTtwTI=; b=mtsdF2BPb3Hvxte+KciX6Uw/1TWbij09SwYxJ4JVjncdvJKK32lLAeHqyR/Y5JTqyJ Mme+u1ye42md4FVqWe4XCdswUTSV5AdPIY5XVJj7gqGxYSIrUKpEjmEyVCGt+/K1f5Cd 2wbL+OfuFkKxZjYT6jp8XYQFo7DUHnksaBAzTQ5c9G/sxW2lkhN40GKOJ5v0ly5fwUar mB9g+pfKPl6yZuGcJhOLheScNlOO5dTXwYGS9dAD784R+3za4qhRy5baRYUNhZOenhS6 vir/pVPW5isqi60G0pZn4sgXS+aVbCndS7V2gUZ0jTDEJwvGixaqzN6wiCmB1pm5jwTp 6lQQ== X-Forwarded-Encrypted: i=3; AJvYcCUK2P2uc4ngBVHOLzQFAKOR0+Ad0WH0yDLurOUHJjM1IOIW8Ece3ieikfXChJKGtLnvmMzwYg90yw==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0Yx2AMKTreA/pTldW6bXrJ53O3wEXmsvcP/MVKFdF++nmVB+2V+6 9Cl9mKbEOTBzwnYG3vOXRkgjfsM+WpDBBLDtLlX7cxbrjVLX+asc X-Google-Smtp-Source: AGHT+IFIMoHB/3W6DkpkvTme8QHEfmtHBmaiGlPfjcftk2+D/fPnWzvQddKJUA/3d++fwnqNsOKTvQ== X-Received: by 2002:a92:c564:0:b0:3a0:92b1:ec4c with SMTP id e9e14a558f8ab-3a375bb7860mr136302565ab.23.1728391759536; Tue, 08 Oct 2024 05:49:19 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6e02:1c45:b0:3a0:beb4:f1e6 with SMTP id e9e14a558f8ab-3a36e46d4d8ls27125965ab.1.-pod-prod-05-us; Tue, 08 Oct 2024 05:49:18 -0700 (PDT) X-Received: by 2002:a05:6e02:1a8a:b0:3a0:90c7:f0f with SMTP id e9e14a558f8ab-3a375ba9911mr132898275ab.15.1728391758161; Tue, 08 Oct 2024 05:49:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728391758; cv=pass; d=google.com; s=arc-20240605; b=S2B26RJsOU8/Qoo1ueg87QxVMYo6xX171aVN2WJKqYkZwaCZQ6F9Zg8gBf3MXN8e8j p3tVh2TlYDlarZRN7m3SydgpxHa5l+sPpmpBc0w6e7NUME2Z1JXbUx7x/COn3YxRGSH5 dwu6T5eFACu+G6hEO8hlaSbYZ3RvhVpSM/UfYcZfcp5Y1C8yO/4srn5DOuYb1Ks91i76 KsTaMaqfAR2Uoy3MpRdvHp8CTRgwwp5rJlJp0dgbKqjklP/vCmaP0pYB48l4iM4vMhVy fz9fw46WHWCRKze8qBRnsHBxwIIiquG6RKLFuhdFqktAyURvcwhO39Si/NaL2sk4Notm G+tQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:content-transfer-encoding:in-reply-to:organization :from:content-language:references:to:subject:user-agent:date :message-id:dkim-signature; bh=0DNAMWPgqtGsBr5gXPAKXsBxwK0PoQPnaLjOWH96tos=; fh=ZnR/GV7fAozRX3tpIO3vp/Jbul8ISZhdVjghlw9eWq0=; b=HOG9ESkP8XXdMIPYABfjeu6X+SiWbYKCdawFtCnZtcjTKw7+zOU4aaFvf3zO3EFANP 9lTwMIGbpDuokgC6doGHN+9lxqIHU0NtvzgqzLI+IWEGxeqKq6ABZVkzeWL9QQJoGMgp buJG3KZu2/zzgvMyjNjVBaTNskx+7OVtWcSbm/kOqSiW8tEzvz0772yWie53ym5vsgEO NPEd3brvE2QmK/6e9ZF4DTqbugFC4fxoijqeoe5DSZnE6Jxcb/AZgAVFq2AydXVKYEO9 nXFcJiJgYyjTw7C34viIw7A9Rl95H9+6hieVobFCK4HQOyXee5uufv6GpKuCyLF9451o GnLg==; dara=google.com ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=K4gYBL2p; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2614::700 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20700.outbound.protection.outlook.com. [2a01:111:f403:2614::700]) by gmr-mx.google.com with ESMTPS id e9e14a558f8ab-3a37a7600e9si2720265ab.0.2024.10.08.05.49.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2024 05:49:17 -0700 (PDT) Received-SPF: pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2614::700 as permitted sender) client-ip=2a01:111:f403:2614::700; ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gwCBRxgpdkIuNGmFByv8ed/ok+pshI3fuaRTAvhExysmYK9+uC+sERzKIWxBgkkhxVX2mA0ScHE0XbYVRUfwBvORUlucNyTlRYQ2nYFgV1zUHFF5hOS0RAlaR0gyiWUFNVJjCSjqPjt4s4e8d1a0afpTrd0KUhLToKugJjQqD4gG0ekiMgsbgLj9UNpW3UnrI1sSDBFQyDQyc0j+5Vm/ycG90ou+gI3ujvZKPzXsp3mw9SZCk6tUSR4ylh80gUnaySkFFCb1vupuC3P6wPrJPS4gB4A3hTDuYb2iE9QPCnbcch2TN+M6XwvgXQxJjDQcz7VfQ65wkxRswbxS6AnjIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0DNAMWPgqtGsBr5gXPAKXsBxwK0PoQPnaLjOWH96tos=; b=lpKrm6hHy04KXBoELjdTKN+5TZBxuckD7Ms9d1bC/FpPytjlY62qHacdMnZ9Q1qLpTI5LetMVFxAZw9O5zxnGWjSmPxBNsksPGW4XO52aa3nwJ22CSLliySPb5t2DL/0JAOL7SR4o+bg7KXWFyfMXVycXw2wBCDHB53n5LXQKZ5ILzFhY4yNOIrWfeSaGhrvHC9WEucYNNM9PmllJDkllaOTCDfcoAOJBWRYWGgJQncMFLbcOASGNVKEg+WKZkqTP0MY2KYHakfLCFig5v6yDmdB3PzA3vfskNbrLkzEVKVUVMjcbbIo8toGkLYL5sOyzR5ugBHId3n++vx6wDD8gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=witekio.com; dmarc=pass action=none header.from=witekio.com; dkim=pass header.d=witekio.com; arc=none Received: from PAWP192MB2225.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:359::22) by DU0P192MB2076.EURP192.PROD.OUTLOOK.COM (2603:10a6:10:47b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Tue, 8 Oct 2024 12:49:15 +0000 Received: from PAWP192MB2225.EURP192.PROD.OUTLOOK.COM ([fe80::8a5a:c9f5:c976:7b14]) by PAWP192MB2225.EURP192.PROD.OUTLOOK.COM ([fe80::8a5a:c9f5:c976:7b14%3]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 12:49:15 +0000 Message-ID: Date: Tue, 8 Oct 2024 14:49:14 +0200 User-Agent: Mozilla Thunderbird Subject: [swupdate] [PATCH 2/3] progress: add non-blocking progress_ipc_receive_nb To: swupdate References: <20241008123845.32785-1-fhoerni@free.fr> <97f79916-508f-41e4-893f-ef575c135c8c@witekio.com> Content-Language: en-US X-Patchwork-Original-From: "'Frederic Hoerni' via swupdate" From: "fhoerni.opensource" Organization: Witekio In-Reply-To: <97f79916-508f-41e4-893f-ef575c135c8c@witekio.com> X-ClientProxiedBy: PA7P264CA0017.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:2df::20) To PAWP192MB2225.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:359::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAWP192MB2225:EE_|DU0P192MB2076:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b9ba718-eb24-49aa-9337-08dce7979dd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Kmo4yV3jYwQtkm0Z0aNuQyqdaYaQmaO?= =?utf-8?q?M1WNBByeD4HmB/owcoz4esWwzsdsjSWyHB7P3SqfqjY1j2MVRz+UHWBXvW//+AD1h?= =?utf-8?q?kFYzDF+7YeKckPOteidzIfm5oNwBnPvMzNGSX1nVn+IgnMDeTUmTNdnqBKHK42aEC?= =?utf-8?q?hHKkWthTYnWcbjTM57BK6zJDb7C72gywmiFCt2swoOuAYZHXU8IsG/3eMeKWcK/YU?= =?utf-8?q?Plq8mMzP7kk+VS6cxz22OZpyjLXGyIFUY5VCk5Xb0d1Lsd4RHaKJ6Ev+SR5MYCdl6?= =?utf-8?q?NgJICXpzNWInbO5pnaU1BI0BHdIubKDw2PhRUPYYoVFBNpPHXzy+CXb0tjQH+kGW8?= =?utf-8?q?AnckOPg1zaKtP+opIcZ59xZAZQGLCYvMln44nPGWffQRygUmFcInVQTzag2TTZJFL?= =?utf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CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWP192MB2225.EURP192.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?L7M0xt+cwtNBuePp/BnvOJVWIeW6?= =?utf-8?q?cWkyWFyTBTQ+V9gc8RV1a3iwZUqfnDzmUFkDELlly+2q7+ViGuxaTQZXC460pHMcB?= =?utf-8?q?P/VN4WgqbFHVw+UV7Ej03whfgFQ/cqyyj2wovX3+tVwuWCTStSOUxEPu1g5W7npph?= =?utf-8?q?5fhbsDDenp8Wtz3Q8vfigZEqHieJm2LCTQ1PRIDEJPeGhO475g16uBVCgWaOhcftz?= =?utf-8?q?gN+Wg1j27J5RfKWPyZw/bhlzCUSYiG+eHXYylu2uWp/pMnkQ3i8eZ1OS9KRs1B5sZ?= =?utf-8?q?XeljAstzJlvKC7pcgdSNuW0RotrH3C12LvY1eR55iON7eG6g2+3MnKegqVujz0fnX?= =?utf-8?q?RvJbCe/sv55DUGw/4ODnHeptwj/gj/TQ0PM7reLldqejZvgy9+0sgrGCxFQPsRSon?= =?utf-8?q?FHSwOhGKBCc2b/CJFEjjTKVAiFIjs7RwGUtXZbekL69RKXvtog63J92QUrrHS+iKR?= =?utf-8?q?p7p9AXf4kHIGHzDnXpCY4wFtTwxCU78A/znSu5gyzjHVbO/mFMYLxG+8YUT8exP4F?= =?utf-8?q?Nl9Jnxcglm1BkL+2gTHfBwMIyHgCEtSIjPpUyviLND+zDqldMgvc7fqurt2Wk/hcn?= =?utf-8?q?JRNr9e8TlinovXMISjukoodRLdVJnLSgmO/pSHBlUjRmADLyP0orzBFqe3zKsAtCn?= =?utf-8?q?3xsn5vF6vJ3riXDpb2bpqCmA2XdzdO3kvN1GJX3oPyyGLEnc1hZECTyHfQ6vadk7y?= =?utf-8?q?XM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aa-9337-08dce7979dd5 X-MS-Exchange-CrossTenant-AuthSource: PAWP192MB2225.EURP192.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 12:49:15.4713 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 317e086a-301a-49af-9ea4-48a1c458b903 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WOHPJZYDcAJKbX5GfAASVE1mz2GAEVj1wYy0ZjrS7i6qNaSnIoLQq6WxB1Ek4RsP7ZtCbREPpAHHngpuKahz9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0P192MB2076 X-Original-Sender: fhoerni.opensource@witekio.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=K4gYBL2p; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2614::700 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com X-Original-From: Frederic Hoerni Reply-To: Frederic Hoerni 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: , From: Frederic Hoerni The function progress_ipc_receive_nb is a non-blocking variant of progress_ipc_receive. Signed-off-by: Frederic Hoerni --- include/progress_ipc.h | 3 ++- ipc/progress_ipc.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/include/progress_ipc.h b/include/progress_ipc.h index e79d476d..8d63d1ca 100644 --- a/include/progress_ipc.h +++ b/include/progress_ipc.h @@ -86,8 +86,9 @@ int progress_ipc_connect(bool reconnect); */ int progress_ipc_connect_with_path(const char *socketpath, bool reconnect); -/* Retrieve messages from progress interface (it blocks) */ +/* Retrieve messages from progress interface (blocking and non-blocking) */ int progress_ipc_receive(int *connfd, struct progress_msg *msg); +int progress_ipc_receive_nb(int *connfd, struct progress_msg *msg); #ifdef __cplusplus } // extern "C" diff --git a/ipc/progress_ipc.c b/ipc/progress_ipc.c index 815e1601..e9b5218e 100644 --- a/ipc/progress_ipc.c +++ b/ipc/progress_ipc.c @@ -218,3 +218,35 @@ int progress_ipc_receive(int *connfd, struct progress_msg *msg) { return ret; } + +int progress_ipc_receive_nb(int *connfd, struct progress_msg *msg) { + int ret = -1; + int err_poll; + struct pollfd pfds[1]; + pfds[0].fd = *connfd; + pfds[0].events = POLLIN; + do { + err_poll = poll(pfds, 1, 0); + } while (err_poll == -1 && errno == EINTR); + + if (err_poll == -1) { + fprintf(stderr, "progress_ipc_receive_nb: poll error\n"); + ret = -1; + } else if (err_poll == 0) { + /* no pending message */ + ret = 0; + } else if (pfds[0].revents & POLLIN) { + /* there is a message to read or the peer closed its end of the channel */ + /* (some operating systems set POLLIN|POLLHUP on this later case) */ + ret = progress_ipc_receive(connfd, msg); + } else if (pfds[0].revents & POLLHUP) { + /* the peer closed its end of the channel */ + ret = -1; + } else { + /* unexpected error */ + fprintf(stderr, "poll returned %d with revents=0x%x\n", ret, pfds[0].revents); + ret = -1; + } + + return ret; +} From patchwork Tue Oct 8 12:50:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "fhoerni.opensource" X-Patchwork-Id: 1994238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=H0StyQcJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::13f; helo=mail-il1-x13f.google.com; envelope-from=swupdate+bncbclmhafq4qcrbeovss4amgqexhpdxwq@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-il1-x13f.google.com (mail-il1-x13f.google.com [IPv6:2607:f8b0:4864:20::13f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XNG8P5bD8z1xtV for ; Tue, 8 Oct 2024 23:50:29 +1100 (AEDT) Received: by mail-il1-x13f.google.com with SMTP id e9e14a558f8ab-3a19665ed40sf41191955ab.1 for ; Tue, 08 Oct 2024 05:50:29 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1728391826; cv=pass; d=google.com; s=arc-20240605; b=IPrx6VCxOReGK4S5NxHlTWJSGg2b5vnXAQnUkYIzhvGXt8YbplhMsAgUy90rUuSXTB HuxjDAbRRjlmA6/QecMO3Z+oecPl9dNsZpMmYZwr6ysnC0Ar0sCEfNNSdYCcEOMx/XhJ IEVAO0GwutbyW5O8S5jQ2UWfmShYCe+VIQxKGf59mfUaRvMuUKz0eNE2byXViNuMqhIo qpG6YDdXcw69qoYUWaqDEwtaqv+G/Lw0eamxkVcn8ckwJiMAOpCeoH1TGa4La2oIbXyH ypNoiWi6m1iKVaGVAx7JS9FoeI/SxHd5f5uE4xRmUwKoAiywSKMW9i8nMQeKOgo0vVrc 6+EA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:in-reply-to :organization:from:content-language:references:to:subject:user-agent :date:message-id:dkim-signature; bh=vNdR8ckDr/Q56ZFA5V4eDHpIkGQbqLDd4Ek7rF3FXP0=; fh=PLUIJt/exlx2kKgVgF8cbuuRVdm8e1FIc27E9Z2Juy0=; b=SfGR4Zjd4hgH0jmuGlFOuugHepGKgtnv5ERd7MpG8OJZOyTI075Xlq82pPcwgOvvbE PcYjy1IJpVUishSaSpLRo/nesZpbwPJgUD2QRPLI75efijQtHxZBFX/PotwbBYn/oQ0S ElaqV+zmR+Rfy986oyLESpJvZQK7N3k0b9eyUAxQu2VzHlvfwvi8bha7CcRny23yIc1p n0TB0TKT2GkhyHI2u6HlUZCjrV/PHVC0VOLHlZjG4qIOOoGEIG5bOJGVYGfCCuB79/2T rieH4pt0YMuJLlAHo/aXhl5voxqRIV+G2lAWPz7wqu+I9xLxhLfRY5Xg11M/O08T7+M5 earQ==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=o51yYw8Z; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2612::715 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1728391826; x=1728996626; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :in-reply-to:organization:from:content-language:references:to :subject:user-agent:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=vNdR8ckDr/Q56ZFA5V4eDHpIkGQbqLDd4Ek7rF3FXP0=; b=H0StyQcJrsnFe9BilZKQVimPDHOWXwq0qc4C2cyN2hZviE4PBOhFltUpFlVPa9JR6U Y/JM2Cl5qiHelPRkj9A5cJZrDIADqToKJcFh3fJoaAcUH85PEHTc3z838XTHwsRbY1oD M42XMautZzPczUCdbXxR4CRQCC911bZfQfWpHeaFGq+rX5+KR3x2bqTO/1/4e8YZzECZ PYnp5mktihRp1hWPttaFyl/uIUbEMrawDq1BNQGQ7+keJWAal5/Su8iGo9tgiC3FChBE HxoYLiLr94oGdGDQuBjXbDghJsdgqNua3IykpFJfvZ50ApVTIbA0bJdVLLbR7teQGOdM TsZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728391826; x=1728996626; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :in-reply-to:organization:from:content-language:references:to :subject:user-agent:date:message-id:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vNdR8ckDr/Q56ZFA5V4eDHpIkGQbqLDd4Ek7rF3FXP0=; b=o/104h0X6UQU7gmeh5ONyu/YWNWQsMnbsJSVAkOxA59KAxmV2plbw9EjZaxng3N5az CMNBrZCecRDCSyMvPUBTzPrqmFQqNdiFL5MPgt2Qj1jpFKAgNfUGpu/m5AjR8/ln8Vgy WNHly3q15NldnV3bKVT0ygfZEn01DLT0uh6rdFCh8XKQejEdbRmbJGYL30VEylxwqr/m ZQK7FBmtTdv/RMSe2EEvCGRwdYMih8LKn9xi//JqC3RdqSWAdbYX8GTa1TgzJJJw9q5n 7u2l1QlgeoG9lalMXFifZSQ2YSwSgFhR6EL9vLRbSsph0HfTfH1B5jRn+cG1sY2eQFVn 0YxA== X-Forwarded-Encrypted: i=3; AJvYcCUu8lDSU7fY1DWQiCUNZwFUCPU3D+GHH4SzOd70NhEyphvFKfEqz7lY38vC9ZXECa+El1lM5llxDQ==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0Yw1fBRSGtrQQ6brXnJ0dPMjaxxDHShf/L02yn0a0LFTNKSlf0iF Dg67d2ylFZP5SSxSuQpclvUtYk+S4zSwdD5k8jZimJsc3NrQGXwM X-Google-Smtp-Source: AGHT+IGeBpsyKYX7U7rY9NzNc4unBJlP7z/kpY+qz1gNNsrwWVJKBvj/WTee3Tuh6ouNqrmFixamgw== X-Received: by 2002:a05:6e02:1908:b0:39f:507a:6170 with SMTP id e9e14a558f8ab-3a394653c8bmr262675ab.8.1728391826194; Tue, 08 Oct 2024 05:50:26 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6e02:1a44:b0:3a0:99ea:845a with SMTP id e9e14a558f8ab-3a36e498518ls20247695ab.2.-pod-prod-00-us; Tue, 08 Oct 2024 05:50:25 -0700 (PDT) X-Received: by 2002:a05:6e02:1c41:b0:3a2:6d54:33df with SMTP id e9e14a558f8ab-3a38af1d874mr26102115ab.4.1728391824934; Tue, 08 Oct 2024 05:50:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728391824; cv=pass; d=google.com; s=arc-20240605; b=iNPX+kwzlFG3c3ZGywHolbGL0SesPmSUmTg8/qNGYS0HnbPxeqTWVeSBHavs8QdUEc LpwNJZ8eKgPVLyo8/NWA1AKBMEflb9p+B11Xd8oQUP9WxUPgcvnhZR2+vYnIZZMDD11c ZuTb7d2QQ5xJ7yF79glLpBmrfYb5XBu5V77pH8Tb6BZMdAzqZRknMSMF2NhSxxsmtDtv USPfNyWLoaPTCOV96H2r2FkSHFt0ATy92NZDmDEztjo1rtI7achhcQRQvh2bbPrqNJPL qUc/sB0pf0C0iHdVwZXN0fAfNquDJyOGq5D9Jy32jYQWExxhP92YwFegKbCennig8CnX An/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:content-transfer-encoding:in-reply-to:organization :from:content-language:references:to:subject:user-agent:date :message-id:dkim-signature; bh=TsDP2peO53tZ/JOTFIo++O5PdwJySJimj34fiO6X8b8=; fh=ZnR/GV7fAozRX3tpIO3vp/Jbul8ISZhdVjghlw9eWq0=; b=gYskQhdRy7Jk1ZRVisHkVPNAwg91VEUdpdZXLBQGTSpHWB2fYABDbiSR9tvtLhV0Y9 zH4Z32lt19DQe3EGIjMxxF2eUIr+7+M562Ta6iCTJxHNukFksi79HqfYMTG0d5RE1krt TAavSDOOfTNa7BjH9N3XklSYsuqnHQjoeMldWuYTPkwfCDaGV7N+xkOgucIk/1vJ0vjf l5U20eohRgFCtrFSXGWa1oZGpLKXGkRgJr0LX6bgZx1BRO1cES7uQl4v6RW1hb+e4hHH uYZPX6rqW6vMwX4PlDUc2GBTQkwmZdCJ7xOCcMmWBQXPplJcJ7I15SjDiqzpwWMLK35u YJxg==; dara=google.com ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=o51yYw8Z; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2612::715 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20715.outbound.protection.outlook.com. [2a01:111:f403:2612::715]) by gmr-mx.google.com with ESMTPS id 8926c6da1cb9f-4db7f376ad9si267814173.0.2024.10.08.05.50.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2024 05:50:24 -0700 (PDT) Received-SPF: pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2612::715 as permitted sender) client-ip=2a01:111:f403:2612::715; ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MDV35bVXfJt5BpOD0JEBp0I3yz3Y4Di6bZNb9X8XX2WgTB0/eaSTSnW/G/u82pHhj1UjbksJpkApJroiJ2aKyrcOidk8PMOYOvojuxujcp85wSmWO/TpYnxiLmQbRM8NEiH+qSADDzO3EFwIVheWuq1wS0JLJMqmjFXMd8kZoDez3gDTMSEyOH2DeZZsRh9abtaADmoqzsSIuhamho4nS9FtYv39py13rmAfoV51PQLKEj5ivUXXA+SM0ERIdK7QEFh1W3BtJl+gW8AQDK7e1PPv4OQ8Ev1cyo4No6vIamgw1HAa3iebbozAxxDV/qADdSI7tn9sNTxDavPg2W/OyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TsDP2peO53tZ/JOTFIo++O5PdwJySJimj34fiO6X8b8=; b=rwglxc06bFhNXkNpZQ0arHcue451uy01MDQAG4LE+G9LDSssvzBlzwQl8YQWGsgV/DBcNoMMR1brYW/qTtpJyhr1g+uMiMmviqOzkYFNUMC3uAgSZJFzfnHslxcvLud5u2RfmpkbJpHHWx9CQUWChphDFpZ3lmBults2tdlrpB9SX5XyscAVd6rxw3pRyGPucYLj5cE2v4hOgGFX00YoJR41Ost4evefgnSyvl9ejeU2DhtaaFI2TSbAupxdnE6c4vX/F8E05eY5G82sw2fx/XUzjxNKcDi4jL0S8oa8VE2JT274SsgsLaLRUU9ccJiIlbTQ6xvNVEiNkDaapgKdCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=witekio.com; dmarc=pass action=none header.from=witekio.com; dkim=pass header.d=witekio.com; arc=none Received: from PAWP192MB2225.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:359::22) by DU0P192MB2076.EURP192.PROD.OUTLOOK.COM (2603:10a6:10:47b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Tue, 8 Oct 2024 12:50:21 +0000 Received: from PAWP192MB2225.EURP192.PROD.OUTLOOK.COM ([fe80::8a5a:c9f5:c976:7b14]) by PAWP192MB2225.EURP192.PROD.OUTLOOK.COM ([fe80::8a5a:c9f5:c976:7b14%3]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 12:50:21 +0000 Message-ID: Date: Tue, 8 Oct 2024 14:50:20 +0200 User-Agent: Mozilla Thunderbird Subject: [swupdate] [PATCH 3/3] swupdate_async_start: fix early termination blocking in client To: swupdate References: <20241008123845.32785-1-fhoerni@free.fr> <97f79916-508f-41e4-893f-ef575c135c8c@witekio.com> Content-Language: en-US X-Patchwork-Original-From: "'Frederic Hoerni' via swupdate" From: "fhoerni.opensource" Organization: Witekio In-Reply-To: <97f79916-508f-41e4-893f-ef575c135c8c@witekio.com> X-ClientProxiedBy: PA7P264CA0016.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:2df::11) To PAWP192MB2225.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:359::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAWP192MB2225:EE_|DU0P192MB2076:EE_ X-MS-Office365-Filtering-Correlation-Id: d728f4c8-d53e-4188-a6a0-08dce797c538 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?uXzwMslrA9LMg4dGClm2/2EzKZebp7m?= =?utf-8?q?uiHam+CvVfgbhH+kw3otdqKhootVaCj8FsOCwZo883LOcS/sIIXGpa7WrdJq6iwr1?= =?utf-8?q?xAB9tvEkCwzaJEHhH7Ighl7c/GtW41t0ZlWAWq58Bbezr3AgVY/V4e5haeZ4OS0+o?= =?utf-8?q?JiOh2HxPHDyWZcA1atmS29VTFBML/pwVYSYp19D/tXgecq/lVsw7xVIaLxq143Eyf?= =?utf-8?q?RSMM8V6cwgcEX3bHBB8xAHepxkzdEESFZL20E7vt4lrAUT2vuUmS8jHUiXJ0y8jr6?= =?utf-8?q?fCPDMvUj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?q?BM/cfZ7rObqheALX4SPjaDOaqlIS+m0snRaVhiaJ6JjoDJ/UsU+SQTKZdOQWAp2vP?= =?utf-8?q?uCmSwqTny+NrBQU6lZeSuNm61rJAozepPPuA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWP192MB2225.EURP192.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?JIkfKpKb+XMSJN6Ub/AQliOgWjh+?= =?utf-8?q?kFkqbUoFq//EPGOZzyYPaRggVTKchouMlsU3wmlq9jbG5cDyna35l+HkQhg1AMuUV?= =?utf-8?q?pJ4zPj6ptc5RYOZ6LKo74dGJTWcjVjIdOP0qgsYv+XhVEdBNYu5sZVNo67cd01o4C?= =?utf-8?q?EfX4iTD2SSeLLlzudleZE6RGXvRw6X7M1pE0UF129iNIXuV5UbnxOoxr4rjFNg98X?= =?utf-8?q?8OZujL5urr/L0M11I2k/8j7EpgnkUBAKPCZazXN0x8JRGw6i+ZX4r2IslAuStF9Bq?= =?utf-8?q?0lTfRoM0hHnphX6riXbzNxY9Y/1iBO/yfgzfvnZdM5OsU3d8FdWzB5p2pztWphw+a?= =?utf-8?q?TQuJyYTG8pSrmFMsSzBccqdeu+IqJ8EhpC2Zl2L4cL2pbpu7FkaEs6WLIQwM++vc+?= =?utf-8?q?/kQyZeMU3KnWHz6FlujqchKJgbek/bCwLXHV8OhZsPFxxoHSSOVkeeB6lWR+OJ2k0?= =?utf-8?q?lUqwIs5LEQQFVnVJ66BC2LxifxRdt9zoko2xlp64BKFdMJY3vLpiCBrzv2KgDsXRA?= =?utf-8?q?RZ2EaaQVplotZ5uG7N58wwt3xIHKeFw7ipGCZIgXr84Ox1aipp3P26dKmLz63865V?= =?utf-8?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M0jEdiukDNtww22fAQAWupukak757fhe/C8N3pFchsYiFVY7egXVS/EpkCAYI/?= =?utf-8?q?0QE91C8DAD0c?= X-OriginatorOrg: witekio.com X-MS-Exchange-CrossTenant-Network-Message-Id: d728f4c8-d53e-4188-a6a0-08dce797c538 X-MS-Exchange-CrossTenant-AuthSource: PAWP192MB2225.EURP192.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 12:50:21.5713 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 317e086a-301a-49af-9ea4-48a1c458b903 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Yrx5OpjekEB4N8oszzGk2SHSEmBIGnOAKHNfG/+EG5asBy5hp71SoAFtUPxQf2nrnffeLSYSiBJVysaTUSUe0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0P192MB2076 X-Original-Sender: fhoerni.opensource@witekio.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@witekio.com header.s=selector2 header.b=o51yYw8Z; arc=pass (i=1 spf=pass spfdomain=witekio.com dkim=pass dkdomain=witekio.com dmarc=pass fromdomain=witekio.com); spf=pass (google.com: domain of fhoerni@witekio.com designates 2a01:111:f403:2612::715 as permitted sender) smtp.mailfrom=fhoerni@witekio.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=witekio.com X-Original-From: Frederic Hoerni Reply-To: Frederic Hoerni 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: , From: Frederic Hoerni It could happen on the client side, that the termination status of the installation was missed, leading to the client waiting forever. This modification connects the progress socket before sending the image payload, to be sure not to miss the termination status (SUCCESS or FAILURE). We also need to consume the events during the image transfer, so that the pipe does not get full and block the daemon. Signed-off-by: Frederic Hoerni --- ipc/network_ipc-if.c | 96 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 84 insertions(+), 12 deletions(-) diff --git a/ipc/network_ipc-if.c b/ipc/network_ipc-if.c index 65b60b48..f7727346 100644 --- a/ipc/network_ipc-if.c +++ b/ipc/network_ipc-if.c @@ -102,6 +102,52 @@ static void unstack_installation_status(getstatus callback) } while (ipcmsg.data.status.current != IDLE); } +/* Consume progress events + * + * Returns: + * -1 error + * FAILURE the installation failed + * SUCCESS the installation suceeded + * 0 no events or other events consumed + * + * On error, progressfd is closed and set to -1. + */ +static int consume_progress_events(int *progressfd) +{ + struct progress_msg progressmsg; + int ret = -1; + + /* Wait until the end of the installation (FAILURE or SUCCESS) */ + while (1) { + ret = progress_ipc_receive_nb(progressfd, &progressmsg); + if (ret == -1) { + /* Note that progressfd may have been closed by progress_ipc_receive + * and set to -1 */ + fprintf(stderr, "progress_ipc_receive_nb failed (%d)\n", ret); + break; + } else if (ret == 0) { + /* no pending message */ + break; + } + + if (progressmsg.status == FAILURE || progressmsg.status == SUCCESS) { + /* We have the final result of the installation */ + ret = progressmsg.status; + break; + } else { + /* Other status (START, RUN, PROGRESS) */ + /* continue consuming messages */ + continue; + } + } + + if (ret == -1 && *progressfd >= 0) { + close(*progressfd); + *progressfd = -1; + } + + return ret; +} static void *swupdate_async_thread(void *data) { @@ -113,6 +159,8 @@ static void *swupdate_async_thread(void *data) struct async_lib *rq = (struct async_lib *)data; int swupdate_result = FAILURE; int progressfd = -1; + int ret; + int early_status = -1; sigemptyset(&sigpipe_mask); sigaddset(&sigpipe_mask, SIGPIPE); @@ -122,6 +170,16 @@ static void *swupdate_async_thread(void *data) swupdate_result = FAILURE; goto out; } + /* Start listening to progress events, before sending + * the image so that we don't miss the result event. + */ + progressfd = progress_ipc_connect(0 /* no reconnect */); + if (progressfd < 0) { + fprintf(stderr, "progress_ipc_connect failed\n"); + ipc_end(rq->connfd); + goto out; + } + /* Start writing the image until end */ do { @@ -136,26 +194,40 @@ static void *swupdate_async_thread(void *data) goto out; } } + /* Consume progress events so that the pipe does not get full + * and block the daemon */ + ret = consume_progress_events(&progressfd); + if (ret == -1) { + /* If we cannot get events, then we won't be able to get the result. + * Quit and fail */ + fprintf(stderr, "Cannot consume progress events. Fail.\n"); + early_status = FAILURE; + break; + } else if (ret == FAILURE || ret == SUCCESS) { + /* early termination */ + fprintf(stderr, "early termination while sending the image: %s\n", + ret==SUCCESS?"SUCCESS":"FAILURE"); + early_status = ret; + /* interrupt the transfer */ + break; + } } while(size > 0); - /* Start listening to progress events, before ipc_end - * so that we don't miss the result event. - */ - progressfd = progress_ipc_connect(0 /* no reconnect */); - ipc_end(rq->connfd); - if (progressfd < 0) { - fprintf(stderr, "progress_ipc_connect failed\n"); - goto out; - } - /* * Everything sent, wait for completion of the installation */ - /* Wait until the end of the installation and get the final result */ - swupdate_result = inst_wait_for_complete(&progressfd); /* progressfd closed by the call */ + if (early_status >= 0) { + swupdate_result = early_status; + close(progressfd); + progressfd = -1; + + } else { + /* Wait until the end of the installation and get the final result */ + swupdate_result = inst_wait_for_complete(&progressfd); /* progressfd closed by the call */ + } /* * Get and print all status lines, for compatibility with legacy programs