From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaKXU-0001hn-A9 for qemu-devel@nongnu.org; Thu, 09 May 2013 02:41:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaKXT-0006mA-F8 for qemu-devel@nongnu.org; Thu, 09 May 2013 02:41:16 -0400 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:39842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaKXT-0006lw-9Y for qemu-devel@nongnu.org; Thu, 09 May 2013 02:41:15 -0400 Received: by mail-wi0-f179.google.com with SMTP id l13so2714034wie.12 for ; Wed, 08 May 2013 23:41:14 -0700 (PDT) Date: Thu, 9 May 2013 08:41:11 +0200 From: Stefan Hajnoczi Message-ID: <20130509064111.GC1074@stefanha-thinkpad.redhat.com> References: <1367568009-4900-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1367568009-4900-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] curl: fix curl read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Fri, May 03, 2013 at 04:00:09PM +0800, Fam Zheng wrote: > @@ -391,7 +427,12 @@ static QemuOptsList runtime_opts = { > .type = QEMU_OPT_SIZE, > .help = "Readahead size", > }, > - { /* end of list */ } > + { > + .name = "ssl_no_cert", > + .type = QEMU_OPT_BOOL, > + .help = "SSL certificate check", > + }, This new option should be in a separate patch. > + if (!strncmp(s->url, "http://", strlen("http://")) && !s->accept_range) { > + strncpy(state->errmsg, "Server not supporting range.", CURL_ERROR_SIZE); > + goto out; > + } This check is unrelated to the API change and should be in a separate patch. > s->multi = curl_multi_init(); > - curl_multi_setopt( s->multi, CURLMOPT_SOCKETDATA, s); > - curl_multi_setopt( s->multi, CURLMOPT_SOCKETFUNCTION, curl_sock_cb ); > - curl_multi_do(s); > + if (!s->multi) { > + goto out_noclean; > + } > + curl_multi_setopt(s->multi, CURLMOPT_SOCKETDATA, s); > + curl_multi_setopt(s->multi, CURLMOPT_SOCKETFUNCTION, curl_sock_cb); > + curl_multi_setopt(s->multi, CURLMOPT_TIMERDATA, s); > + curl_multi_setopt(s->multi, CURLMOPT_TIMERFUNCTION, curl_multi_timer_cb); > + curl_multi_socket_action(s->multi, CURL_SOCKET_TIMEOUT, 0, &running); The timeout should be added in a separate patch. > + cache = curl_find_cache(s, aio_base, aio_bytes); > + if (cache) { > + curl_complete_io(s, acb, cache); > + return; > } What is the point of the cache? Can you split it into a separate patch? > + /* Try to release some cache */ > + while (0 && s->cache_quota <= 0) { while 0?