Message ID | 20231120155459.45188-5-stefano.babic@swupdate.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBAABBWEC52VAMGQEC43CGHY@googlegroups.com> 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=MuNLRFKM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::237; helo=mail-lj1-x237.google.com; envelope-from=swupdate+bncbaabbwec52vamgqec43cghy@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lj1-x237.google.com (mail-lj1-x237.google.com [IPv6:2a00:1450:4864:20::237]) (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 4SYsXY4kQ2z1yRg for <incoming@patchwork.ozlabs.org>; Tue, 21 Nov 2023 02:55:08 +1100 (AEDT) Received: by mail-lj1-x237.google.com with SMTP id 38308e7fff4ca-2c5194d4e98sf38788681fa.3 for <incoming@patchwork.ozlabs.org>; Mon, 20 Nov 2023 07:55:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700495705; cv=pass; d=google.com; s=arc-20160816; b=kqexdvhLcnV1OXfz8bFeB0NX46V4STlfJf5r1tZXHFCxRqtocvzTCcJ4t4vXZnVEpF 0u7eR6IhLNWvRmqyuUxobZAYxzEf1fEYzS69DrQNsGgQHfyYOvOp6d1V1bA6vjZux8Sy s5mPVu9xD/5S6fBX2NabDFVZj8+WBEyU9YbN+N3QKdPyH/BitjnNypnOpWSJyLBKssGj gPHns0kNVpzG6TKqVUKO+IWUvwvIdKe01ZyWRBobdMfuPQQpZdHsQ8krXkH8qFqB9rNj YYo9muTTxJsW7wrOoLWvb+++S8LumfrwpX15a1ZZB9rTiyIdwwM2TNEeaPxCfdCqCOwl lyCg== 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:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=kIVXoXnJ5KvgsU+DoQiVwOA4nE4V9JzbQvuxzSABGjA=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=KwnBt0uCj24iL8ZiyS5BeKmt2o+IMHbAxj9jf24UkyLJweGoBfkykieCyOy1JZXITp jMZ34FzctjXdS7yFClhYmKm+/9aPT7VJKcYG+MGqlexKifs8OuKKW96uKQj7Vl/WAGuT L37bt1ODSdG0p4u/S54zpwb+zAQcY+N+iHWVmsQh6pg6OLqLoY2z0oZ4IvvcKTlz3vTv SxJEww6pAraLROqti64nPKYlysN94Rs4cvxrj7kWu3/CsA6jNg9kyOjQgEpoEgwyFhLz jfy3/dhsWQ7pBpMTvST9gCRIXAOdlsH/wmEtnMI2DFkIfp4ZM1CYeK2bQqHt49SMMiv7 bYuQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1700495705; x=1701100505; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=kIVXoXnJ5KvgsU+DoQiVwOA4nE4V9JzbQvuxzSABGjA=; b=MuNLRFKMSHnm6BtyObuYaIDe7rLSu8/qLI39tfSyvOUqm+vTJDG5lFRMiosNtwkZ3H GWEUY92g3nvyDyAyNlXTQV2J0DmfqiPrBsjTdXM2sYTZEeHlILGswqo5ioMG+4f2QsQw 1B2qwXSwmEnp0a5t/UawOLVGyQBQGyftcrmbl2POvT2VU71q8JqhKGoKo18XYgo+MC/O d87Ka8TQTeYpjY7yWbkN3lMwQwj4Z37y++x1LT2ammYl5UrVwGuqivQYaV4m4HLHtwOX fxGXmVAyikpEjpNKRWKq9KAGQrpxjE1dZwum6/F8+czeUh9tlUC0sFR3OsfmryMYMh7D ChQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700495705; x=1701100505; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=kIVXoXnJ5KvgsU+DoQiVwOA4nE4V9JzbQvuxzSABGjA=; b=AB+qeX7JJuP7sYoThVGgTexHm4dunMoupefG5sZqxFX+viAqZWj3ZgqUwMso7GHFzQ iywqfGjaEChOSXMbURKDPxOZeAgw+w6zRz8cSc5HaSQS49noa0do3x2L1QdIvOINFu1c G7fJup4FdyWLCJ3hfMt6l0Fs3vGTvYoLTKVSM+YZ2sSUi3GQjNSJujSNwhwiALhsHRHF nCn0lVYlOhmy0qR+wtCOoXk1LXUmGLv7BG5TPz1m0m8Pp6ijvivPraZB1+tLDkJE2SFB 20vTJZhdhWD+DGjfFnwjppfRsg2f/Dx9UT6NA+Uu5khLqq4ruvTsHnaBvhfeSy9Et/aA qnMQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0Yw8U6lTPKM2bBGmkW/NKlitRFHh69cvE8BOiHosYRlVyOGkBie3 jFjLiWv3fwhz3Zm+t12cjZk= X-Google-Smtp-Source: AGHT+IHmLn1g+00umquTS5J+KvEdr23Hz2VX8OVfz3Paj5i9h1/BFD3QruGilahUZ+UJR4V6XB+FdQ== X-Received: by 2002:a2e:a4da:0:b0:2c8:83c4:9067 with SMTP id p26-20020a2ea4da000000b002c883c49067mr2054506ljm.44.1700495705145; Mon, 20 Nov 2023 07:55:05 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:651c:2124:b0:2c8:797f:444f with SMTP id a36-20020a05651c212400b002c8797f444fls33447ljq.2.-pod-prod-06-eu; Mon, 20 Nov 2023 07:55:03 -0800 (PST) X-Received: by 2002:a2e:98d3:0:b0:2c8:5906:2dac with SMTP id s19-20020a2e98d3000000b002c859062dacmr5554512ljj.47.1700495703190; Mon, 20 Nov 2023 07:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700495703; cv=none; d=google.com; s=arc-20160816; b=lWZQt6185qK1evMizSRxWtAKwxt1LIiI3d3EEAY03CJyUAuhNlCXeko509DfYgc//7 1a9y1+1KgJfuadjzEQDie/T1sadzHkf9TbATqFQbraKMnMVeCn2OrX6XvMV2rcWCzVlV 3gNy40GOgYE3mBlScRFu4y0jPw8u/vHur5jJllAKyUxzBguIdBZ8Djr01Lp2Q97MItw6 yMIAgVvcswl1Vz90daljZ34RrodUtMz0xiSYoEnJfiIh5M5oK87lzl1CMH/QiisKOu8L YNfDYYotARRFzOOQEG+xXs3VIZW52X2yUwXjugseRNvXfY4QpbvsRwHbFE2LFUqWJNzY uXOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=iyy+wAXDGN8b1jRe5BjqU2KQg9FWbOynAh0popuVv64=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=PgF99PjCfPoUw+C/rYSfeRBpj7ZZMWy2wI9h25cz9zJ3iJkiI+hqKFsGH1HtAw1455 J+7k7PA/JVjv+j3+RgyrFACnNgwHDTZptUnjZXHf55OaC5ORI7TiouuFNDU9vAH0X79p FeJhncg3ptUg3fwgVj70qH4zgXZ6dSrlMQ0TbTy1MDPAIATAtZzGZ4t2lREKPKR0HTIn zqAfrgGuDA1Mx+QzSFALkGpvRS3FGMTQ9WpjYO57ywOhcl8kgP2xFkc8vozdUeqb4oN2 toym3G4R7rZ2OZ7SwrrVnNxfxX0jfyDgRVQ2Qk4+izTYJN0OpOvn+ZQHhz88fNcQ1hYY TP7g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.74]) by gmr-mx.google.com with ESMTPS id l23-20020a2ea317000000b002b9d5a29ef7si308116lje.4.2023.11.20.07.55.03 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 07:55:03 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) client-ip=217.72.192.74; Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MXY2T-1qq7Ef1u6p-00Z0wp; Mon, 20 Nov 2023 16:55:02 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH 04/13] swuforwarder: fix error branch in curl read callback Date: Mon, 20 Nov 2023 16:54:50 +0100 Message-Id: <20231120155459.45188-5-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231120155459.45188-1-stefano.babic@swupdate.org> References: <20231120155459.45188-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:oBiHkv29LBVspOIpMIx09it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VXj3YRCL0 50lz5hk0VLYsCe1Mo2ojgdSHNB/qVbztVtXT1AuYrE5qN0Xl3CtdgINILzLcwJSOAhviuzZnS +dLkVkpffh0XNCYTOG+EJujws9s/21k0miT4= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[01/13] configs: update after removing CONFIG_HANDLER_IN_LUA
|
expand
|
diff --git a/handlers/swuforward_handler.c b/handlers/swuforward_handler.c index 468fbfb1..8e8c757e 100644 --- a/handlers/swuforward_handler.c +++ b/handlers/swuforward_handler.c @@ -70,14 +70,15 @@ static size_t curl_read_data(char *buffer, size_t size, size_t nmemb, void *user nbytes = nmemb * size; nbytes = read(conn->fifo[0], buffer, nbytes); - if (nbytes == -1 && errno == EAGAIN) { - TRACE("No data, try again"); - nbytes = 0; - } if (nbytes < 0) { - ERROR("Cannot read from FIFO"); - return CURL_READFUNC_ABORT; + if (errno == EAGAIN) { + TRACE("No data, try again"); + nbytes = 0; + } else { + ERROR("Cannot read from FIFO"); + return CURL_READFUNC_ABORT; + } } nmemb = nbytes / size;
The error branch is wrongly implemented, fix it. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- handlers/swuforward_handler.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)