From patchwork Sun May 2 11:36:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gio--- via openwrt-devel X-Patchwork-Id: 1472770 X-Patchwork-Delegate: baptiste@bitsofnetworks.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=kzU3isXY; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (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 4FY3yw4DJvz9sCD for ; Sun, 2 May 2021 21:38:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:Date:Subject:To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=o06zpjcIiDpdPx0h4q9lu2vq8+WmuE6ukCFWUoq18so=; b=kzU3isXYkteb6J+NXshfMg63/5 JpwaS6TGPkZkxFobWj8TA00SkZ5ZLXXgRI2+WktD6YMkqpdouVsNlA5iGTkLdGothWkd6VVe9t6uV BzvF2fOPWDB/y4kleMLJQCCgA0Izyu8aFY1oT4w3UxP01MvdAdJGwacqxNcejZ5ETR22ZYGAqh5gl 3xmIhO/kUC25UDMXiVB9knT+5zw20eM8WhiqVeeLCCEJ8wt1FH7c6tV+CMy50GhZilA5biyrOfe4i Rty9IFYFSMLsjcAxhJFKBE+UzOMvhXZGSU7lKGItcEhBV6RnuTM0xt55AXU5vr+93a0OqYKUmXyaS PJZ2WJmQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ldAOk-00Bger-N7; Sun, 02 May 2021 11:36:30 +0000 To: openwrt-devel@lists.openwrt.org Subject: [PATCH] Fix URL validation for more than one URLs. Date: Sun, 2 May 2021 13:36:26 +0200 MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: Fabian Baumanis via openwrt-devel From: gio--- via openwrt-devel Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: fabian.baumanis@mailbox.org List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. From: Fabian Baumanis --- uclient-fetch.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/uclient-fetch.c b/uclient-fetch.c index 282092e..d046100 100644 --- a/uclient-fetch.c +++ b/uclient-fetch.c @@ -384,14 +384,23 @@ static void request_done(struct uclient *cl) if (n_urls) { proxy_url = get_proxy_url(*urls); if (proxy_url) { - uclient_set_url(cl, proxy_url, NULL); + error_ret = uclient_set_url(cl, proxy_url, NULL); uclient_set_proxy_url(cl, *urls, auth_str); } else { - uclient_set_url(cl, *urls, auth_str); + error_ret = uclient_set_url(cl, *urls, auth_str); } + + if (error_ret < 0) { + fprintf(stderr, "Failed to allocate uclient context for %s\n", *urls); + uclient_disconnect(cl); + uloop_end(); + return; + } + n_urls--; cur_resume = resume; error_ret = init_request(cl); + if (error_ret == 0) return; }