From patchwork Mon Mar 5 15:40:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 881549 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:400c:c0c::239; helo=mail-wr0-x239.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbnok6xkakgqef63bwda@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=siemens.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="COEfQKYH"; dkim-atps=neutral Received: from mail-wr0-x239.google.com (mail-wr0-x239.google.com [IPv6:2a00:1450:400c:c0c::239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zw3zr0gMvz9s3p for ; Tue, 6 Mar 2018 02:41:43 +1100 (AEDT) Received: by mail-wr0-x239.google.com with SMTP id v16sf11588910wrv.14 for ; Mon, 05 Mar 2018 07:41:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1520264501; cv=pass; d=google.com; s=arc-20160816; b=X7imTJNBUNQcIPGRy+6f0oiIi2leLGFweZP0fYS7OjHgIeBRsCDfESiuWvGuGC7Wcx ZJ5AF1hEimUKLgKXsEzJ96IP9jNnfz/uRVHgY92R/jwsa8cG+CZ7UR3EiaRYAcDSxoQa OJXj1t1HTfUtYzD4s7FbYfv0CnA7SEhLW5BjdkeJ/RGk5Ya7P/zLlkv+BDFwAzEdlzSA 5vLXyfStI41C25xXb9W/rewvnTs23mEWIg88P2NqvlKwURjfPluVdnfbS7nqbswY0RSj V7HAITJp7Ej5XkbppuXM0EJi0SsLuZNrGNOF7KAvKewCMM6CA7DhGU66mhrxKFEYfTsq JVgw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:arc-authentication-results :arc-message-signature:mime-version:sender:dkim-signature :arc-authentication-results; bh=bvO+bWWYu2DoXLfTMtcnuve/vJCZxDU5JUaQBI4qKmE=; b=bneLYhjUx+28iZLjBJ38sJaDhe8Vg5u87r5fZ5OWOQYCis/tZXWXKr56TyhVYV7Mef 1wbFoc6qqON/PDS9yM9yajMwLVq8vdLjLJToI4jS/Zo/WtcT31TWGTkMDMO0xYcYoiTe AKOJK2Xoc9X5CIFxzKrGQKiHZ/bv8sg36wrUvUtfRLaKQOdjbnssWqLBVi7K1Xbu1/4l 8qnYjUPRugcI3mU+ViF5gyIR2IfpSySAoyApT+umP5gtq1ZSjHxWb8YlARinolK9eorB jLq+gBf8sKiYzOArieYDwKZiJ7rrdySlApxRy43rWCl6yOKek0clyqID1dAA1zBHxPba kAvg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=christian.storm@siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=bvO+bWWYu2DoXLfTMtcnuve/vJCZxDU5JUaQBI4qKmE=; b=COEfQKYHdbXk5eYY6ATAebGISeeKJuJr9U28r976vSuqaUfkB96fj8qXheCE3tkJIA EEc8HL8C38sejQFAr8AlSanmxR9cjsrbCe26RyPg+O0EBaIovq1XbhwiO67RmM/UKecv h0pF6G732/ukL/g7YDovtWcVuNE87Oo7saSiwVAjFo9u0mRZca5aEJIUXKbpVTvJiw0p Cmx0k0oHCNI3f8PD33RsIFtuTE09rEBKLHvFgRm5odTp6p9UmZXcZCfaBi2+qP75X+do i0kxwUNwJK/rOCtzKnSGf/4eYHYf5I5LaaMQ1j81gcdGWv8/ScoDXTivNPjpbtw2chuE 9H7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references: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=bvO+bWWYu2DoXLfTMtcnuve/vJCZxDU5JUaQBI4qKmE=; b=gz6dh9y/hAMiDZv93lAn6nTdFLPbj8Iu1hMlaCdYBvVbehCnQTNC7AHp9LFXpt6ksh 11VOtYD/iNOo2w7vWF6dcwMx/2i/Y8Cdc7C7/7STpcPgup9bqqKHnYWenKvrqa3++S3k Ob/s9KgGjmm2YnqznKtMLmZXK0sY7LPkmvmncE2JgPU2WpX0jLe39kiayOE4CzVDZSlh nXTgxBrH4PIgUmn5eJCf+UqbRU9G3NU7v42K3z/YZXQDDF4dtaq0G0AQkjykWOPZvdY1 ByKIEPO1Gqo9lczyZwgi3KcIMhvc6RLAGniqRI8CqlWjPY4II2+or35nJ0RkM48BZSR+ qmpw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AElRT7ExTurP7kOUzGnPNhToNf0WoABByhBH6mqLglKMsoIXVxAUviEX sZfP0gt3h1pyR4pNEYo1N8s= X-Google-Smtp-Source: AG47ELvy/JyOMUZ2O35h0KX+cQnGj3stOFuNzk+Frg5wFOfeZdTmpB0XLZhQTNOCMH8Klud6mzswAA== X-Received: by 10.28.122.20 with SMTP id v20mr63125wmc.7.1520264501513; Mon, 05 Mar 2018 07:41:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.190.10 with SMTP id a10ls8104861edi.6.gmail; Mon, 05 Mar 2018 07:41:41 -0800 (PST) X-Received: by 10.80.202.199 with SMTP id f7mr4455934edi.12.1520264500984; Mon, 05 Mar 2018 07:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520264500; cv=none; d=google.com; s=arc-20160816; b=Q/edTHXjOWozX3wckttwEk0z8m3UOSzxsftfIeyDcpUHFfgJ3migsJZg3Sadhb3wlp IWNT6gSt73mfna3rSpwWj0s6QBHRw7/Rj1sxypGBlUP6SFdJzQoRcJI7dc9Yi+TpFsAn otx1MDMSFzBivhJtRItS7D2aUnDa/xItFFCMUZ5lTlYxpwjYQ/5vwbi1Rx2TY2xGIw1B oxQAo9yuhh8WxfNNSFYzxia3hPvTzrKl7pfXEmttafPKVy/0/IRUtEwOuqpT2Hd/1FYd IhfKOJzOYjTLX8jWrcxkPcwUX5Kn7fK7VTYYtp9saXGYSN7De1ZYnpxr8bleekE4eXTi e3RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=UWnObXEzlRP5njY+GpOLG4YVYNqiZdElw/SkJJsUVpg=; b=fokuo3a83yg/1l9XuIx8/jlJC6ws8Airaugs4ZwOvVMrY2C7fUQ5WyG9f57s24ZWN9 MxWZ0JkDhBpEwCYRfX48R3Wrp84XLtp21AEME+S6RPIJB/GNJY4eCL9uCKx/JZoefNCW VozfSoJ6cDE5uXPN/zu4XCvtOb9hnNM4H8L2FXF6MOPuMkFEn8HMzDHID50r9s5KDZNy hO/d7VwywvVL28Oak+li0YN1eX5L91I4c+eP3pRHB4MnKJnPwMsGPfOQbAEPGBBQfIfn uuNeZlyWAyaprh62Eav6lwVr0aKmph35VBfEo3df0CF6dOfTpsFVa6HMGEoK02Gid7bV z4Ow== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id g21si193190edj.5.2018.03.05.07.41.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 07:41:40 -0800 (PST) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w25Ffe2X008922 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 5 Mar 2018 16:41:40 +0100 Received: from MD1KR9XC.ww002.siemens.net ([139.25.69.202]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w25FfRYI022466; Mon, 5 Mar 2018 16:41:40 +0100 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH 3/8] channel_curl: make low_speed_timeout configurable Date: Mon, 5 Mar 2018 16:40:01 +0100 Message-Id: <20180305154006.18122-3-christian.storm@siemens.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180305154006.18122-1-christian.storm@siemens.com> References: <20180305154006.18122-1-christian.storm@siemens.com> X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=christian.storm@siemens.com 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: , downloader.c has a command line flag '--timeout' setting cURL's low speed limit time period. Make this setting configurable for channel_curl in preparation to make the downloader use channel_curl. Signed-off-by: Christian Storm Reviewed-by: Stefano Babic --- corelib/channel_curl.c | 8 +++++++- include/channel_curl.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index a94243d..ea23f61 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -331,6 +331,12 @@ channel_op_res_t channel_set_options(channel_t *this, channel_data_t *channel_data, channel_method_t method) { + if (channel_data->low_speed_timeout == 0) { + channel_data->low_speed_timeout = SPEED_LOW_TIME_SEC; + DEBUG("cURL's low download speed timeout is disabled, " + "this is most probably not what you want. " + "Adapted it to %us instead.\n", SPEED_LOW_TIME_SEC); + } channel_curl_t *channel_curl = this->priv; channel_op_res_t result = CHANNEL_OK; if ((curl_easy_setopt(channel_curl->handle, CURLOPT_URL, @@ -340,7 +346,7 @@ channel_op_res_t channel_set_options(channel_t *this, (curl_easy_setopt(channel_curl->handle, CURLOPT_LOW_SPEED_LIMIT, SPEED_LOW_BYTES_SEC) != CURLE_OK) || (curl_easy_setopt(channel_curl->handle, CURLOPT_LOW_SPEED_TIME, - SPEED_LOW_TIME_SEC) != CURLE_OK) || + channel_data->low_speed_timeout) != CURLE_OK) || (curl_easy_setopt(channel_curl->handle, CURLOPT_HTTPHEADER, channel_curl->header) != CURLE_OK) || (curl_easy_setopt(channel_curl->handle, CURLOPT_MAXREDIRS, -1) != diff --git a/include/channel_curl.h b/include/channel_curl.h index 5afb66f..eec071e 100644 --- a/include/channel_curl.h +++ b/include/channel_curl.h @@ -43,6 +43,7 @@ typedef struct { unsigned int offs; unsigned int method; unsigned int retries; + unsigned int low_speed_timeout; bool debug; bool usessl; bool strictssl;