RE: windows compile error
Found it. Using the 23:00 connect.c and the 23:59 retr.c does produce the bug. Using the 23:59 connect.c and the 23:00 retr.c works ok. This means the problem must be in retr.c . Heiko -- -- PREVINET S.p.A. www.previnet.it -- Heiko Herold [EMAIL PROTECTED] -- +39-041-5907073 ph -- +39-041-5907472 fax -Original Message- From: Hrvoje Niksic [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 12:38 AM To: Herold Heiko Cc: List Wget (E-mail) Subject: Re: windows compile error Herold Heiko [EMAIL PROTECTED] writes: Repeatable, and it seems to appear with this: 2003-09-15 Hrvoje Niksic [EMAIL PROTECTED] * retr.c (get_contents): Reduce the buffer size to the amount of data that may pass through for one second. This prevents long sleeps when limiting bandwidth. * connect.c (connect_to_one): Reduce the socket's RCVBUF when bandwidth limitation to small values is requested. Previous checkout (checkout -D 23:30 15 sep 2003) wget works fine. I also found a public site which seems to expose the problem (at least from my machine): wget -dv https://www.shavlik.com/pHome.aspx dies after DEBUG output created by Wget 1.9-beta on Windows. [...] Herold, I'm currently having problems obtaining a working SSL build, so I'll need your help with this. Notice that the above change in fact consists of two changes: one to `retr.c', and the other to `connect.c'. Please try to figure out which one is responsible for the crash. Then we'll have a better idea of what to look for.
Re: windows compile error
Herold Heiko [EMAIL PROTECTED] writes: Found it. Using the 23:00 connect.c and the 23:59 retr.c does produce the bug. Using the 23:59 connect.c and the 23:00 retr.c works ok. This means the problem must be in retr.c . OK, that narrows it down. Two further questions: 1) If you comment out lines 180 and 181 of retr.c, does the problem go away? 1a) How about if you replace line 181 with `dlbufsize = sizeof(dlbuf)'? 2) Do you even specify --limit-rate? If so, to what size?
RE: windows compile error
1), 1a), 2) no, no and no. Heiko -- -- PREVINET S.p.A. www.previnet.it -- Heiko Herold [EMAIL PROTECTED] -- +39-041-5907073 ph -- +39-041-5907472 fax -Original Message- From: Hrvoje Niksic [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 12:16 PM To: Herold Heiko Cc: List Wget (E-mail) Subject: Re: windows compile error Herold Heiko [EMAIL PROTECTED] writes: Found it. Using the 23:00 connect.c and the 23:59 retr.c does produce the bug. Using the 23:59 connect.c and the 23:00 retr.c works ok. This means the problem must be in retr.c . OK, that narrows it down. Two further questions: 1) If you comment out lines 180 and 181 of retr.c, does the problem go away? 1a) How about if you replace line 181 with `dlbufsize = sizeof(dlbuf)'? 2) Do you even specify --limit-rate? If so, to what size?
Re: windows compile error
I've noticed the mistake as soon as I compiled with SSL (and saw the warnings): 2003-09-18 Hrvoje Niksic [EMAIL PROTECTED] * retr.c (get_contents): Pass the correct argument to ssl_iread. Index: src/retr.c === RCS file: /pack/anoncvs/wget/src/retr.c,v retrieving revision 1.57 diff -u -r1.57 retr.c --- src/retr.c 2003/09/15 21:48:43 1.57 +++ src/retr.c 2003/09/18 11:41:56 @@ -191,7 +191,7 @@ ? MIN (expected - *len, dlbufsize) : dlbufsize); #ifdef HAVE_SSL if (rbuf-ssl!=NULL) - res = ssl_iread (rbuf-ssl, dlbufsize, amount_to_read); + res = ssl_iread (rbuf-ssl, dlbuf, amount_to_read); else #endif /* HAVE_SSL */ res = iread (fd, dlbuf, amount_to_read);
RE: windows compile error
Works. New windows test binary at the usual place. Heiko -- -- PREVINET S.p.A. www.previnet.it -- Heiko Herold [EMAIL PROTECTED] -- +39-041-5907073 ph -- +39-041-5907472 fax -Original Message- From: Hrvoje Niksic [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 1:43 PM To: Herold Heiko Cc: List Wget (E-mail); [EMAIL PROTECTED] Subject: Re: windows compile error I've noticed the mistake as soon as I compiled with SSL (and saw the warnings): 2003-09-18 Hrvoje Niksic [EMAIL PROTECTED] * retr.c (get_contents): Pass the correct argument to ssl_iread. Index: src/retr.c === RCS file: /pack/anoncvs/wget/src/retr.c,v retrieving revision 1.57 diff -u -r1.57 retr.c --- src/retr.c2003/09/15 21:48:43 1.57 +++ src/retr.c2003/09/18 11:41:56 @@ -191,7 +191,7 @@ ? MIN (expected - *len, dlbufsize) : dlbufsize); #ifdef HAVE_SSL if (rbuf-ssl!=NULL) - res = ssl_iread (rbuf-ssl, dlbufsize, amount_to_read); + res = ssl_iread (rbuf-ssl, dlbuf, amount_to_read); else #endif /* HAVE_SSL */ res = iread (fd, dlbuf, amount_to_read);
RE: windows compile error
Does compile now, but I managed to produce an application error during a test run on a https site. I produced a debug build with /DDEBUG /Zi /Od /Fd /FR and produced the wget.bsc by running bscmake on all the sbr files, but I didn't yet understand how to use that one in VC++ in order to get a meaningfull stack trace and so on. The only thing I got for now is :SSLEAY32! 0023ca38() as the breaking point. Anybody knows to to debug this beast or how to generate a working project file in order to make the source browser work ? Heiko Herold -- -- PREVINET S.p.A. www.previnet.it -- Heiko Herold [EMAIL PROTECTED] -- +39-041-5907073 ph -- +39-041-5907472 fax -Original Message- From: Hrvoje Niksic [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 11:02 PM To: Herold Heiko Cc: List Wget (E-mail) Subject: Re: windows compile error Herold Heiko [EMAIL PROTECTED] writes: Just a quick note, the current cvs code on windows during compile (with VC++6) stops with cl /I. /DWINDOWS /D_CONSOLE /DHAVE_CONFIG_H /DSYSTEM_WGETRC=\wgetrc\ /DHAVE_SSL /nologo /MT /W0 /O2 /c utils.c utils.c utils.c(1651) : error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 The culprit seems to be (in wtimer_sys_diff) #ifdef WINDOWS return (double)(wst1-QuadPart - wst2-QuadPart) / 1; #endif Does this patch help? 2003-09-16 Hrvoje Niksic [EMAIL PROTECTED] * utils.c (wtimer_sys_diff): Convert the time difference to signed __int64, then to double. This works around MS VC++ 6 which can't convert unsigned __int64 to double directly. Index: src/utils.c === RCS file: /pack/anoncvs/wget/src/utils.c,v retrieving revision 1.54 diff -u -r1.54 utils.c --- src/utils.c 2003/09/15 21:14:15 1.54 +++ src/utils.c 2003/09/16 21:01:02 @@ -1648,7 +1648,10 @@ #endif #ifdef WINDOWS - return (double)(wst1-QuadPart - wst2-QuadPart) / 1; + /* VC++ 6 doesn't support direct cast of uint64 to double. To work + around this, we subtract, then convert to signed, then finally to + double. */ + return (double)(signed __int64)(wst1-QuadPart - wst2-QuadPart) / 1; #endif }
Re: windows compile error
Herold Heiko [EMAIL PROTECTED] writes: Does compile now, but I managed to produce an application error during a test run on a https site. I produced a debug build with /DDEBUG /Zi /Od /Fd /FR and produced the wget.bsc by running bscmake on all the sbr files, but I didn't yet understand how to use that one in VC++ in order to get a meaningfull stack trace and so on. The only thing I got for now is :SSLEAY32! 0023ca38() as the breaking point. It sounds like an https thing. Is the error repeatable? If so, can you repeat it an earlier CVS snapshot?
RE: windows compile error
Repeatable, and it seems to appear with this: 2003-09-15 Hrvoje Niksic [EMAIL PROTECTED] * retr.c (get_contents): Reduce the buffer size to the amount of data that may pass through for one second. This prevents long sleeps when limiting bandwidth. * connect.c (connect_to_one): Reduce the socket's RCVBUF when bandwidth limitation to small values is requested. Previous checkout (checkout -D 23:30 15 sep 2003) wget works fine. I also found a public site which seems to expose the problem (at least from my machine): wget -dv https://www.shavlik.com/pHome.aspx dies after DEBUG output created by Wget 1.9-beta on Windows. --17:23:55-- https://www.shavlik.com/pHome.aspx = `www.shavlik.com/pHome.aspx' Resolving www.shavlik.com... 65.173.207.46 Caching www.shavlik.com = 65.173.207.46 Connecting to www.shavlik.com[65.173.207.46]:443... connected. Created socket 112. Releasing 009D00D0 (new refcount 1). ---request begin--- GET /pHome.aspx HTTP/1.0 User-Agent: Wget/1.9-beta Host: www.shavlik.com Accept: */* Connection: Keep-Alive Pragma: no-cache ---request end--- HTTP request sent, awaiting response... HTTP/1.1 200 OK Cache-Control: private Content-Length: 14115 Content-Type: text/html; charset=utf-8 X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Server: WEBSERVER Date: Wed, 17 Sep 2003 15:27:28 GMT Connection: keep-alive Found www.shavlik.com in host_name_addresses_map (009D00D0) Registered fd 112 for persistent reuse. Length: 14,115 [text/html] 0% [ ] 0 --.--K/s Heiko -- -- PREVINET S.p.A. www.previnet.it -- Heiko Herold [EMAIL PROTECTED] -- +39-041-5907073 ph -- +39-041-5907472 fax -Original Message- From: Hrvoje Niksic [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:44 PM To: Herold Heiko Cc: List Wget (E-mail) Subject: Re: windows compile error Herold Heiko [EMAIL PROTECTED] writes: Does compile now, but I managed to produce an application error during a test run on a https site. I produced a debug build with /DDEBUG /Zi /Od /Fd /FR and produced the wget.bsc by running bscmake on all the sbr files, but I didn't yet understand how to use that one in VC++ in order to get a meaningfull stack trace and so on. The only thing I got for now is :SSLEAY32! 0023ca38() as the breaking point. It sounds like an https thing. Is the error repeatable? If so, can you repeat it an earlier CVS snapshot?
Re: windows compile error
Herold Heiko [EMAIL PROTECTED] writes: Repeatable, and it seems to appear with this: 2003-09-15 Hrvoje Niksic [EMAIL PROTECTED] * retr.c (get_contents): Reduce the buffer size to the amount of data that may pass through for one second. This prevents long sleeps when limiting bandwidth. * connect.c (connect_to_one): Reduce the socket's RCVBUF when bandwidth limitation to small values is requested. Previous checkout (checkout -D 23:30 15 sep 2003) wget works fine. I also found a public site which seems to expose the problem (at least from my machine): wget -dv https://www.shavlik.com/pHome.aspx dies after DEBUG output created by Wget 1.9-beta on Windows. [...] Herold, I'm currently having problems obtaining a working SSL build, so I'll need your help with this. Notice that the above change in fact consists of two changes: one to `retr.c', and the other to `connect.c'. Please try to figure out which one is responsible for the crash. Then we'll have a better idea of what to look for.
Re: windows compile error
Herold Heiko [EMAIL PROTECTED] writes: Just a quick note, the current cvs code on windows during compile (with VC++6) stops with cl /I. /DWINDOWS /D_CONSOLE /DHAVE_CONFIG_H /DSYSTEM_WGETRC=\wgetrc\ /DHAVE_SSL /nologo /MT /W0 /O2 /c utils.c utils.c utils.c(1651) : error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 The culprit seems to be (in wtimer_sys_diff) #ifdef WINDOWS return (double)(wst1-QuadPart - wst2-QuadPart) / 1; #endif Does this patch help? 2003-09-16 Hrvoje Niksic [EMAIL PROTECTED] * utils.c (wtimer_sys_diff): Convert the time difference to signed __int64, then to double. This works around MS VC++ 6 which can't convert unsigned __int64 to double directly. Index: src/utils.c === RCS file: /pack/anoncvs/wget/src/utils.c,v retrieving revision 1.54 diff -u -r1.54 utils.c --- src/utils.c 2003/09/15 21:14:15 1.54 +++ src/utils.c 2003/09/16 21:01:02 @@ -1648,7 +1648,10 @@ #endif #ifdef WINDOWS - return (double)(wst1-QuadPart - wst2-QuadPart) / 1; + /* VC++ 6 doesn't support direct cast of uint64 to double. To work + around this, we subtract, then convert to signed, then finally to + double. */ + return (double)(signed __int64)(wst1-QuadPart - wst2-QuadPart) / 1; #endif }