diff -udr curl-7.10.7-pre4/lib/dict.c curl-7.10.7-pre4-bf/lib/dict.c
--- curl-7.10.7-pre4/lib/dict.c	Fri Jul 25 01:30:58 2003
+++ curl-7.10.7-pre4-bf/lib/dict.c	Tue Aug 12 16:20:57 2003
@@ -92,7 +92,7 @@
   struct SessionHandle *data=conn->data;
 
   char *path = conn->path;
-  long *bytecount = &conn->bytecount;
+  filesize_t *bytecount = &conn->bytecount;
 
   if(conn->bits.user_passwd) {
     /* AUTH is missing */
diff -udr curl-7.10.7-pre4/lib/ftp.c curl-7.10.7-pre4-bf/lib/ftp.c
--- curl-7.10.7-pre4/lib/ftp.c	Sun Aug 10 10:11:41 2003
+++ curl-7.10.7-pre4-bf/lib/ftp.c	Tue Aug 12 16:20:25 2003
@@ -1557,7 +1557,7 @@
 
   /* the ftp struct is already inited in Curl_ftp_connect() */
   struct FTP *ftp = conn->proto.ftp;
-  long *bytecountp = ftp->bytecountp;
+  filesize_t *bytecountp = ftp->bytecountp;
 
   if(data->set.upload) {
 
diff -udr curl-7.10.7-pre4/lib/http.h curl-7.10.7-pre4-bf/lib/http.h
--- curl-7.10.7-pre4/lib/http.h	Mon Aug 11 04:47:45 2003
+++ curl-7.10.7-pre4-bf/lib/http.h	Tue Aug 12 16:17:06 2003
@@ -41,7 +41,7 @@
 /* The following functions are defined in http_chunks.c */
 void Curl_httpchunk_init(struct connectdata *conn);
 CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap,
-                              ssize_t length, ssize_t *wrote);
+                              filesize_t length, ssize_t *wrote);
 void Curl_http_auth_stage(struct SessionHandle *data, int stage);
 #endif
 #endif
diff -udr curl-7.10.7-pre4/lib/progress.c curl-7.10.7-pre4-bf/lib/progress.c
--- curl-7.10.7-pre4/lib/progress.c	Tue May 13 23:31:00 2003
+++ curl-7.10.7-pre4-bf/lib/progress.c	Tue Aug 12 20:57:31 2003
@@ -77,7 +77,7 @@
     sprintf(max5, "%4.1fM", bytes/ONE_MEGABYTE);
     return max5;
   }
-  sprintf(max5, "%4dM", (int)bytes/ONE_MEGABYTE);
+  sprintf(max5, "%4dM", (int)(bytes/(double)ONE_MEGABYTE));
   return max5;
 }
 
diff -udr curl-7.10.7-pre4/lib/transfer.c curl-7.10.7-pre4-bf/lib/transfer.c
--- curl-7.10.7-pre4/lib/transfer.c	Mon Aug 11 04:47:45 2003
+++ curl-7.10.7-pre4-bf/lib/transfer.c	Tue Aug 12 16:24:23 2003
@@ -579,7 +579,7 @@
 
             /* check for Content-Length: header lines to get size */
             if (checkprefix("Content-Length:", k->p) &&
-                sscanf (k->p+15, " %ld", &k->contentlength)) {
+                sscanf (k->p+15, " %lld", &k->contentlength)) {
               conn->size = k->contentlength;
               Curl_pgrsSetDownloadSize(data, k->contentlength);
             }
@@ -1308,12 +1308,12 @@
     if(!(data->set.no_body) && k->contentlength &&
        (k->bytecount != k->contentlength) &&
        !conn->newurl) {
-      failf(data, "transfer closed with %d bytes remaining to read",
+      failf(data, "transfer closed with %lld bytes remaining to read",
             k->contentlength-k->bytecount);
       return CURLE_PARTIAL_FILE;
     }
     else if(conn->bits.chunk && conn->proto.http->chunk.datasize) {
-      failf(data, "transfer closed with at least %d bytes remaining",
+      failf(data, "transfer closed with at least %lld bytes remaining",
             conn->proto.http->chunk.datasize);
       return CURLE_PARTIAL_FILE;
     }
@@ -2024,12 +2024,12 @@
 CURLcode 
 Curl_Transfer(struct connectdata *c_conn, /* connection data */
               int sockfd,       /* socket to read from or -1 */
-              int size,         /* -1 if unknown at this point */
+              filesize_t size,         /* -1 if unknown at this point */
               bool getheader,   /* TRUE if header parsing is wanted */
-              long *bytecountp, /* return number of bytes read or NULL */
+              filesize_t *bytecountp, /* return number of bytes read or NULL */
               int writesockfd,  /* socket to write to, it may very well be
                                    the same we read from. -1 disables */
-              long *writebytecountp /* return number of bytes written or
+              filesize_t *writebytecountp /* return number of bytes written or
                                        NULL */
               )
 {
diff -udr curl-7.10.7-pre4/lib/transfer.h curl-7.10.7-pre4-bf/lib/transfer.h
--- curl-7.10.7-pre4/lib/transfer.h	Thu Jan 16 13:08:13 2003
+++ curl-7.10.7-pre4-bf/lib/transfer.h	Tue Aug 12 16:15:42 2003
@@ -38,11 +38,11 @@
 CURLcode 
 Curl_Transfer (struct connectdata *data,
                int sockfd,		/* socket to read from or -1 */
-               int size,		/* -1 if unknown at this point */
+               filesize_t size,		/* -1 if unknown at this point */
                bool getheader,     	/* TRUE if header parsing is wanted */
-               long *bytecountp,	/* return number of bytes read */
+               filesize_t *bytecountp,	/* return number of bytes read */
                int writesockfd,      /* socket to write to, it may very well be
                                         the same we read from. -1 disables */
-               long *writebytecountp /* return number of bytes written */
+               filesize_t *writebytecountp /* return number of bytes written */
 );
 #endif
diff -udr curl-7.10.7-pre4/lib/urldata.h curl-7.10.7-pre4-bf/lib/urldata.h
--- curl-7.10.7-pre4/lib/urldata.h	Mon Aug 11 16:15:41 2003
+++ curl-7.10.7-pre4-bf/lib/urldata.h	Tue Aug 12 18:32:27 2003
@@ -27,6 +27,9 @@
 
 #include "setup.h"
 
+/* XXX Remove me */
+#define filesize_t int64_t
+
 #define PORT_FTP 21
 #define PORT_TELNET 23
 #define PORT_GOPHER 70
@@ -203,8 +206,8 @@
 
   const char *p_pragma;      /* Pragma: string */
   const char *p_accept;      /* Accept: string */
-  long readbytecount; 
-  long writebytecount;
+  filesize_t readbytecount; 
+  filesize_t writebytecount;
 
   /* For FORM posting */
   struct Form form;
@@ -232,7 +235,7 @@
  * FTP unique setup
  ***************************************************************************/
 struct FTP {
-  long *bytecountp;
+  filesize_t *bytecountp;
   char *user;    /* user name string */
   char *passwd;  /* password string */
   char *urlpath; /* the originally given path part of the URL */
@@ -296,10 +299,11 @@
  * losing state.
  */
 
+
 struct Curl_transfer_keeper {
-  int bytecount;                /* total number of bytes read */
-  int writebytecount;           /* number of bytes written */
-  long contentlength;           /* size of incoming data */
+  filesize_t bytecount;                /* total number of bytes read */
+  filesize_t writebytecount;           /* number of bytes written */
+  filesize_t contentlength;           /* size of incoming data */
   struct timeval start;         /* transfer started at this time */
   struct timeval now;           /* current time */
   bool header;	                /* incoming data has HTTP header */
@@ -319,7 +323,7 @@
   char *end_ptr;		/* within buf */
   char *p;			/* within headerbuff */
   bool content_range;      	/* set TRUE if Content-Range: was found */
-  int offset;	                /* possible resume offset read from the
+  filesize_t offset;	                /* possible resume offset read from the
                                    Content-Range: header */
   int httpcode;		        /* error code from the 'HTTP/1.? XXX' line */
   int httpversion;		/* the HTTP version*10 */
@@ -418,12 +422,12 @@
   unsigned short remote_port; /* what remote port to connect to,
                                  not the proxy port! */
   char *ppath;
-  long bytecount;
+  filesize_t bytecount;
   long headerbytecount;  /* only count received headers */
 
   char *range; /* range, if used. See README for detailed specification on
                   this syntax. */
-  ssize_t resume_from; /* continue [ftp] transfer from here */
+  filesize_t resume_from; /* continue [ftp] transfer from here */
 
   char *proxyhost; /* name of the http proxy host */
 
@@ -437,7 +441,7 @@
   struct timeval created; /* creation time */
   int firstsocket;     /* the main socket to use */
   int secondarysocket; /* for i.e ftp transfers */
-  long maxdownload; /* in bytes, the maximum amount of data to fetch, 0
+  filesize_t maxdownload; /* in bytes, the maximum amount of data to fetch, 0
                        means unlimited */
   
   struct ssl_connect_data ssl; /* this is for ssl-stuff */
@@ -475,13 +479,13 @@
 
   /* READ stuff */
   int sockfd;		 /* socket to read from or -1 */
-  int size;		 /* -1 if unknown at this point */
-  long *bytecountp;	 /* return number of bytes read or NULL */
+  filesize_t size;		 /* -1 if unknown at this point */
+  filesize_t *bytecountp;	 /* return number of bytes read or NULL */
           
   /* WRITE stuff */
   int writesockfd;       /* socket to write to, it may very well be
                             the same we read from. -1 disables */
-  long *writebytecountp; /* return number of bytes written or NULL */
+  filesize_t *writebytecountp; /* return number of bytes written or NULL */
 
   /** Dynamicly allocated strings, may need to be freed before this **/
   /** struct is killed.                                             **/

