From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9NCm-0006aj-Hz for qemu-devel@nongnu.org; Wed, 27 May 2009 13:46:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9NCh-0006Yj-GY for qemu-devel@nongnu.org; Wed, 27 May 2009 13:46:20 -0400 Received: from [199.232.76.173] (port=40337 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9NCh-0006YU-6E for qemu-devel@nongnu.org; Wed, 27 May 2009 13:46:15 -0400 Received: from main.gmane.org ([80.91.229.2]:46711 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M9NCe-0006eu-SX for qemu-devel@nongnu.org; Wed, 27 May 2009 13:46:13 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1M9NCa-0004se-0o for qemu-devel@nongnu.org; Wed, 27 May 2009 17:46:08 +0000 Received: from 204.147.152.1 ([204.147.152.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 May 2009 17:46:08 +0000 Received: from void by 204.147.152.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 May 2009 17:46:08 +0000 From: Consul Date: Wed, 27 May 2009 10:45:56 -0700 Message-ID: References: <1243004222-27822-1-git-send-email-agraf@suse.de> <20090527144951.GA4438@amd.home.annexia.org> <4A1D550C.6030807@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <4A1D550C.6030807@codemonkey.ws> Sender: news Subject: [Qemu-devel] Re: [PATCH] Add HTTP protocol using curl v7 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori wrote: > It's already in git. Does it work on Windows for anybody? In my case the git version of configure does not even recognize the presence of libcurl. The hack below makes it to compile in, but running for example "qemu -cdrom http://aleksoft.net/fdbasecd.iso" hangs the emulator with the following log. Any hints? Alex curl --version curl 7.19.5 (i686-pc-mingw32) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3 libssh2/0.18 Protocols: tftp ftp telnet dict ldap http file https ftps scp sftp Features: Largefile NTLM SSL libz C:\qemu-dist>qemu -cdrom http://aleksoft.net/fdbasecd.iso CURL: Opening http://aleksoft.net/fdbasecd.iso * About to connect() to aleksoft.net port 80 (#0) * Trying 74.220.214.207... * connected * Connected to aleksoft.net (74.220.214.207) port 80 (#0) > HEAD /fdbasecd.iso HTTP/1.1 Host: aleksoft.net Accept: */* < HTTP/1.1 200 OK < Date: Wed, 27 May 2009 16:28:38 GMT < Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_pass through/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 < Last-Modified: Wed, 27 May 2009 16:27:53 GMT < ETag: "40719c4-7f2800-46ae75337d440" < Accept-Ranges: bytes < Content-Length: 8333312 < Content-Type: application/octet-stream < * Connection #0 to host aleksoft.net left intact CURL: Size = 8333312 * Closing connection #0 CURL (AIO): Reading 2048 at 0 (0-0) CURL (AIO): Sock action 2 on fd 1828 CURL (AIO): Sock action 4 on fd 1828 * About to connect() to aleksoft.net port 80 (#0) * Trying 74.220.214.207... CURL (AIO): Sock action 2 on fd 1784 * Connected to aleksoft.net (74.220.214.207) port 80 (#0) > GET /fdbasecd.iso HTTP/1.1 Range: bytes=0-0 Host: aleksoft.net Accept: */* CURL (AIO): Sock action 1 on fd 1784 < HTTP/1.1 206 Partial Content < Date: Wed, 27 May 2009 16:28:38 GMT < Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_pass through/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 < Last-Modified: Wed, 27 May 2009 16:27:53 GMT < ETag: "40719c4-7f2800-46ae75337d440" < Accept-Ranges: bytes < Content-Length: 1 < Content-Range: bytes 0-0/8333312 < Content-Type: application/octet-stream < CURL: Just reading 1 bytes read 1 CURL (AIO): Sock action 4 on fd 1784 * Connection #0 to host aleksoft.net left intact diff --git a/block/curl.c b/block/curl.c index 5d1487d..14ce646 100644 --- a/block/curl.c +++ b/block/curl.c @@ -25,8 +25,8 @@ #include "block_int.h" #include -// #define DEBUG -// #define DEBUG_VERBOSE + #define DEBUG_CURL + #define DEBUG_VERBOSE #ifdef DEBUG_CURL #define dprintf(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0) @@ -141,6 +141,7 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) } read_end: + printf("read %x\n",realsize); return realsize; } @@ -255,7 +256,11 @@ static CURLState *curl_init_state(BDRVCURLState *s) break; } if (!state) { +#ifndef _WIN32 usleep(100); +#else + Sleep(0); +#endif curl_multi_do(s); } } while(!state); diff --git a/configure b/configure index bcf1207..c85c29e 100755 --- a/configure +++ b/configure @@ -640,7 +640,7 @@ if test "$mingw32" = "yes" ; then oss="no" linux_user="no" bsd_user="no" - OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501" + OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -DCURL_STATICLIB" fi if test ! -x "$(which cgcc 2>/dev/null)"; then @@ -1103,7 +1103,7 @@ if test "$curl" = "yes" ; then int main(void) { return curl_easy_init(); } EOF curl_libs=`curl-config --libs 2>/dev/null` - if $cc $ARCH_CFLAGS $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then + if $cc $ARCH_CFLAGS -DCURL_STATICLIB -o $TMPE $TMPC $curl_libs > /dev/null 2> /dev/null ; then curl=yes fi fi # test "$curl"