From patchwork Tue May 28 11:32:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard W.M. Jones" X-Patchwork-Id: 246839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2E6CB2C02E8 for ; Tue, 28 May 2013 21:32:47 +1000 (EST) Received: from localhost ([::1]:42315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhI8y-000673-W9 for incoming@patchwork.ozlabs.org; Tue, 28 May 2013 07:32:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhI8g-00066r-95 for qemu-devel@nongnu.org; Tue, 28 May 2013 07:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhI8b-0003xt-1r for qemu-devel@nongnu.org; Tue, 28 May 2013 07:32:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhI8a-0003xh-Os for qemu-devel@nongnu.org; Tue, 28 May 2013 07:32:20 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4SBWJVI000351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 May 2013 07:32:20 -0400 Received: from localhost (vpn1-7-4.ams2.redhat.com [10.36.7.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4SBWITF021118; Tue, 28 May 2013 07:32:19 -0400 Date: Tue, 28 May 2013 12:32:15 +0100 From: "Richard W.M. Jones" To: qemu-devel@nongnu.org Message-ID: <20130528113215.GD5105@redhat.com> References: <1369373827-9152-1-git-send-email-famz@redhat.com> <20130528103520.GB5105@redhat.com> <20130528110155.GC5105@redhat.com> <20130528111401.GA11749@localhost.nay.redhat.com> <20130528112539.GH4515@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130528112539.GH4515@redhat.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Fam Zheng Subject: Re: [Qemu-devel] [PATCH v6 00/12] curl: fix curl read X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes the obvious bug. I wonder if it should be even larger? One use for curl is to install guests using ISOs from websites without having to download the ISO, and I imagine that even a 30 second timeout could be conservative for that task. Rich. diff --git a/block/curl.c b/block/curl.c index 3e330b6..759f7cb 100644 --- a/block/curl.c +++ b/block/curl.c @@ -332,7 +332,7 @@ static CURLState *curl_init_state(BDRVCURLState *s) goto out; } curl_easy_setopt(state->curl, CURLOPT_URL, s->url); - curl_easy_setopt(state->curl, CURLOPT_TIMEOUT, 5); + curl_easy_setopt(state->curl, CURLOPT_TIMEOUT, 30); curl_easy_setopt(state->curl, CURLOPT_WRITEFUNCTION, (void *)curl_read_cb); curl_easy_setopt(state->curl, CURLOPT_WRITEDATA, (void *)state); curl_easy_setopt(state->curl, CURLOPT_PRIVATE, (void *)state);