cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: patch for >2GB files

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 27 Jan 2004 22:14:43 +0100

"Daniel Stenberg" <daniel-curl_at_haxx.se> said:

> I can only think of one way to prevent this ugliness to happen, and that is to
> make sure that the line never grows bigger than 79 columns and to make sure
> that we always print the line using the same width. Currently, getting a time
> that estimates to 4-digit hours don't fit!

Couldn't we remove some of the columns. Like "% Xferd", "Time Current" and
"Average Dload". It's usually similar to "Curr. Speed" AFAICS.
Being accustomed to Wget, it's a bit confusing with so many fields
 
> I do however believe that we have a few spaces in the line that we _can_ save
> to use for additional ETA-widths. We should perhaps consider a fix for when
> that isn't enough anyway, since getting a 64bit filesize with 1byte/sec
> transfer speed will no doubt cause an ETA that is too wide for us... :-)

Maybe it should query the terminal width ($TERM, $COLUMNS).
 
> What problems are there (left) with our current code and MSVC v6?

MSVC has no 'long long' so I'm not sure it's correct to define
HAVE_LONGLONG. But maybe define a new 'curl_longlong_t'
so the mprintf.c code could work for MSVC too. Using 'curl_off_t'
seems wrong for general 64-bit usage.

For curl.exe and str2offset() LLONG_MIN/MAX must be defined as in
strtoofft.c. And there must be a prototype for Curl_strtoll(). Otherwise
the retval is assumed to be int (which gets truncates).

--- CVS-latest/src/config-win32.h Wed Jan 14 08:42:10 2004
+++ src/config-win32.h Fri Jan 23 17:48:04 2004
@@ -26,9 +26,30 @@
 /*************************************************
  * This section is for compiler specific defines.*
  *************************************************/
-#ifdef MINGW32 /* Borland and MS don't have this */
+#ifdef __MINGW32__ /* Borland and MS don't have this */

 /* Define if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1

+/* Define if you have the strtoll function. */
+#define HAVE_STRTOLL 1
+
+#endif
+
+/* cannot use sizeof(curl_off_t) */
+#define SIZEOF_CURL_OFF_T 8
+
+/* These must match the values in ./lib/strtoofft.c */
+#if defined(_MSC_VER) || defined(__WATCOMC__)
+ #define LLONG_MIN 0x8000000000000000i64
+ #define LLONG_MAX 0x7FFFFFFFFFFFFFFFi64
+
+ /* must have protype else MSVC will assume int (i.e. trunate retval) */
+ signed __int64 Curl_strtoll(const char *nptr, char **endptr, int base);
+#endif
+
+#if defined(__MINGW32__)
+#define LLONG_MIN 0x8000000000000000LL
+#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL
 #endif

--- CVS-latest/src/main.c Tue Jan 27 13:39:34 2004
+++ src/main.c Tue Jan 27 21:57:19 2004
@@ -1009,7 +1009,7 @@
   *val = strtoll(str, NULL, 0);
 #else
   /* this is a duplicate of the function that is also used in libcurl */
- *val = Curl_strtoll(str, NULL, 0;
+ *val = Curl_strtoll(str, NULL, 0);
 #endif

-----

--gv

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-27