From patchwork Mon Nov 20 15:54:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1866128 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=vx+ZywjO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::23d; helo=mail-lj1-x23d.google.com; envelope-from=swupdate+bncbaabbwuc52vamgqeirvszjy@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lj1-x23d.google.com (mail-lj1-x23d.google.com [IPv6:2a00:1450:4864:20::23d]) (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 4SYsXb70T7z1yRg for ; Tue, 21 Nov 2023 02:55:11 +1100 (AEDT) Received: by mail-lj1-x23d.google.com with SMTP id 38308e7fff4ca-2c506abc320sf37161321fa.2 for ; Mon, 20 Nov 2023 07:55:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700495708; cv=pass; d=google.com; s=arc-20160816; b=sNRxe1u03p+zkWjvH7zETsAAmJQrQtKEfx8fO7jFC9KYVlXlSFHKKILnAACu5tTd+I Z1CXkeYhY+zZSzmzslVsj3l73XbxekMzhhILo5pQtio6/L93Fz2/i2JRbFfD1O7C9z7I zUtzW4Ym1Y2Teoz+6yhfu1c7THrZ+1la3ulIAoXqq86Hr4RZ9m0oBd2uwQ0Wv9odOIZp f2Xjbrepn0zQJSNYDM22a7XAuBspWTnvbZbYq0ACN53QS6Gq1cr9q1FEcMCS7CNOqECp TOLxBmv2+cpM4BJmWJb68VyhEeEYfc+zwTDrvAQHNzkdzbz6o0d+ckQh0U/t8n/v3Fti XP9w== 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=3cknw1GRLlcnS/eG3Qgso5IPfoehqIB+Fvzil9cDo6g=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=HMbquWrL9KQ2bm3UdQ4+uT4pQV72xSv7FeoJQLADxY45JzS4TcX9Dwr7qLsze0inm+ oiJaiTTJjP7P8Z5QmrZ6TCNeHRyXCaxQPQdNmJsKk5vHRPkjrOiPYZxT0N6x1KBA5EJf BlkqSrdfVMkjqBMOD+XIx3snGTvFOIf0B1BfMpibnRxQ+bwdQq8sxnmLoZNatEhRNr6S Al7Ld+/CUN0NgL7CZzyBNq5rjNW+aSQEStBkrWALRBM1t4mEDHNv7qT7s8qPQNAKyzP2 cgabxq/7XhVuG3D/Et8Q5sAgvzylCfPd+De133UKoITszoMOoRamHZQvSi8+bTmFnjvU vxNw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 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=1700495708; x=1701100508; 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=3cknw1GRLlcnS/eG3Qgso5IPfoehqIB+Fvzil9cDo6g=; b=vx+ZywjO3wMsjeY0IvEqZdevGjak46zlHjomZFmTLgEFr9zdNY2WAM3EiVF9lwRIbT wZxZIg5AVv8wlgJWuA+n380iIrza6UHk3UE4fEHX99Eb+/6l7XeH42UjDHYqBsQHhi+k EMcu2dylQSX55nRoLZNzCM77wF9iqP7MSEorMeXc+YKWg/+bGbbTjPdyuJ3T4UPg00W2 LxR36iPmcaC71nJKPtwZe8Rw2ARl2YV3S98xtC/6Ga9mC+NdXwRp3y0xJkjNopz/z9G2 vVA5VKUZeJK8Xm8D8Z9zZxYeIExVrRnoyTWdM2nk/uuBAcFWbQi+KrrkasnqD3uHTXoQ 9l0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700495708; x=1701100508; 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=3cknw1GRLlcnS/eG3Qgso5IPfoehqIB+Fvzil9cDo6g=; b=UC2kOWEF80k+IgBM7kApbZ7TLWMC+tXJqWf8LO1J0635aKqQ36d9h/e5cnb15w1TZY VlGPXcRoLuUYqnWTjMSGqds3alwvba9Qxw2ulgUWlmK3KkAx/H2IIFos8ZBgzGDDTEel 3B6ycsoBhUgbS2QSM1ssNx9soCDd+nDyJneqnPOUen6ZehZzIvrWdC7Mrk7GiAr7BLbE w2K2W1PIVpud2Gdvz7oR7EdhXRoxX2tZ5LrUtQTRvf7DMk+eFhl2FnF06U7USfif/4Jb o8vH/MatzLKbuTprb2w6fcNSoTIzzsSq7mzDgA40a2csBBO0DYjbb9ld0nLC1zmlYJBJ 4FFw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0Yxbs4rh//hmHdalG0681rstMNZlqxI6sm806v34ZAp0zQnIy4ER N0dbWPIrgFxHbxEIb4tWrss= X-Google-Smtp-Source: AGHT+IF3DaV8/r6s06TUaAuHWDyv1s2DD1Vyy4davDgK1LYVmmmf7w35c5WEsOX9WMGYCfK8h8un1Q== X-Received: by 2002:a2e:5013:0:b0:2c5:b583:f167 with SMTP id e19-20020a2e5013000000b002c5b583f167mr5787224ljb.34.1700495707817; Mon, 20 Nov 2023 07:55:07 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:651c:1181:b0:2c5:12ac:1bb2 with SMTP id w1-20020a05651c118100b002c512ac1bb2ls13630ljo.1.-pod-prod-02-eu; Mon, 20 Nov 2023 07:55:04 -0800 (PST) X-Received: by 2002:a2e:8e32:0:b0:2c8:7665:9ede with SMTP id r18-20020a2e8e32000000b002c876659edemr4084872ljk.19.1700495704330; Mon, 20 Nov 2023 07:55:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700495704; cv=none; d=google.com; s=arc-20160816; b=kAuZyz+7tc0ZVJSALJLgrAKrvmwOBE8o7grgTn1114JGhpf0pXWInwHXqP/n4Ue39K 1gcCE/J/7SG110DRV3GdrKdDKdW6J+KFXLHqwfUrz7xq4Env+wDURhyfpmM93gwoCDaW +/fNi+9lkgoLxKDeoi6jfByyET3ZCKPpon7+0gKqmVQ/yRySidmPiq4e3Tv0tKCHGgix 5hHvqSyap9hW3RHAP95yNUqHmccZgMt9rpCKqfCs9IlknDi2EmYWVJJIpsfynCoUs+8z Y82jJVcne3OK/cwBWaTz+UcBqMDYCcbWNgfeC0zj0L6xj3h3LoT1YJgzPXiNLB60BxhK /4lQ== 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=JrM53N56sSyQS5KlyG8U7MizuHWFrdHi6o4aDA5X5RA=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=DBQQbredSf8j8bLWgqvOUDIc3wPfC7Ixsdo7kdQzDo5pOm8iqk9/ZFILo0A6XeaUQP PhHfioigAvh5x9vkPBrcXGjEscrSi+JkrpGcVPJBjkMNep9oXtXysk4N5BB5VMIHUKRu wymKA0DD/aXseSPLRaSb79FJgXLn9ncaOcvpsjcXu6lYXNnxWj4QLehvWh8eyZiPD8kg 5hQ7OwoY+xsAl+Ik7EH517oambWAey6Uu9S1eS4k134mNeWIV/OJg+YRfJZIVxfMuWLN eVrE/Aom7mTGccEjPSO87tC0/qZD2URzICrlVFlk6eny1RHxMIkGk5H9zPYga+wp/0io s1JA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.10]) by gmr-mx.google.com with ESMTPS id e16-20020a05651c151000b002c820f71e0bsi56776ljf.5.2023.11.20.07.55.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 07:55:04 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) client-ip=212.227.17.10; Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1N336J-1rU6gs2nDJ-013Ngr; Mon, 20 Nov 2023 16:55:03 +0100 From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 12/13] channel_curl: BUG: endloop if no answer is returned Date: Mon, 20 Nov 2023 16:54:58 +0100 Message-Id: <20231120155459.45188-13-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:O50hTK0RNgdarYbF5hDBgbVF8co90ImCFJwHeOvrfa5KPOq3XkH v74wUgxMpqV20LW+beUm9knYqB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z1SHVN7OB+Shyw+HZqdyRRNtC76Iw7NgK ebw4IEI1VhYu27hcHe/isHhpNZ4jj3BWMl34= 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 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org 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: , If there is no answer and the reply is parsed for a JSON message, system remains in an endloop because no JSON error is generated for exiting. Check if there is an answer, and exit from parse_reply in case the buffer is empty. Signed-off-by: Stefano Babic --- corelib/channel_curl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index c498c666..422109a0 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -988,6 +988,9 @@ static channel_op_res_t parse_reply(channel_data_t *channel_data, output_data_t return CHANNEL_ENOMEM; } + if (!chunk->size) + return CHANNEL_OK; + if (channel_data->format == CHANNEL_PARSE_JSON) { assert(channel_data->json_reply == NULL); enum json_tokener_error json_res;