Hi Duane,
I am sending a patch for the squid3-largeobj.
- FTP: size of large files does not show well.
- _DigestFetchState::offset and _DigestFetchState::mask_offset I think
must be 64bit
- fde::bytes_read and fde::bytes_written must be 64 bit
Large files support is still incomplete, more work needed at least for
Range Headers
Regards,
Christos
Index: PeerDigest.h
===
RCS file: /cvsroot/squid/squid3/src/PeerDigest.h,v
retrieving revision 1.1
diff -u -r1.1 PeerDigest.h
--- PeerDigest.h 21 Aug 2006 01:51:49 - 1.1
+++ PeerDigest.h 28 Apr 2007 21:07:51 -
@@ -70,8 +70,8 @@
store_client *sc;
store_client *old_sc;
HttpRequest *request;
-int offset;
-int mask_offset;
+int64_t offset;
+int64_t mask_offset;
time_t start_time;
time_t resp_time;
time_t expires;
Index: fde.cc
===
RCS file: /cvsroot/squid/squid3/src/fde.cc,v
retrieving revision 1.6.6.1
diff -u -r1.6.6.1 fde.cc
--- fde.cc 25 Apr 2007 16:45:10 - 1.6.6.1
+++ fde.cc 28 Apr 2007 21:08:02 -
@@ -56,11 +56,11 @@
#ifdef _SQUID_MSWIN_
-storeAppendPrintf(dumpEntry, %4d 0x%-8lX %-6.6s %4d %7d%c %7d%c %-21s %s\n,
+storeAppendPrintf(dumpEntry, %4d 0x%-8lX %-6.6s %4d %7PRId64%c %7PRId64%c %-21s %s\n,
fdNumber,
win32.handle,
#else
-storeAppendPrintf(dumpEntry, %4d %-6.6s %4d %7d%c %7d%c %-21s %s\n,
+storeAppendPrintf(dumpEntry, %4d %-6.6s %4d %7PRId64%c %7PRId64%c %-21s %s\n,
fdNumber,
#endif
fdTypeStr[type],
Index: fde.h
===
RCS file: /cvsroot/squid/squid3/src/fde.h,v
retrieving revision 1.13
diff -u -r1.13 fde.h
--- fde.h 15 Sep 2006 20:51:21 - 1.13
+++ fde.h 28 Apr 2007 21:08:02 -
@@ -75,8 +75,8 @@
unsigned int write_pending:1;
} flags;
-int bytes_read;
-int bytes_written;
+int64_t bytes_read;
+int64_t bytes_written;
struct {
int uses; /* ie # req's over persistent conn */
Index: ftp.cc
===
RCS file: /cvsroot/squid/squid3/src/ftp.cc,v
retrieving revision 1.63.2.8
diff -u -r1.63.2.8 ftp.cc
--- ftp.cc 25 Apr 2007 16:45:10 - 1.63.2.8
+++ ftp.cc 28 Apr 2007 21:08:14 -
@@ -152,7 +152,7 @@
int fd;
char *buf;
size_t size;
-off_t offset;
+size_t offset;
wordlist *message;
char *last_command;
char *last_reply;
@@ -217,7 +217,7 @@
static IOCB ftpReadControlReply;
static IOCB ftpWriteCommandCallback;
static HttpReply *ftpAuthRequired(HttpRequest * request, const char *realm);
-static wordlist *ftpParseControlReply(char *, size_t, int *, int *);
+static wordlist *ftpParseControlReply(char *, size_t, int *, size_t *);
// sending of the request body to the server
virtual void sentRequestBody(int fd, size_t size, comm_err_t errflag);
@@ -258,7 +258,7 @@
typedef struct
{
char type;
-int size;
+int64_t size;
char *date;
char *name;
char *showname;
@@ -765,7 +765,7 @@
p-type = 'd';
} else {
p-type = '-';
-p-size = atoi(tokens[2]);
+p-size = strtoll(tokens[2], NULL, 10);
}
snprintf(tbuf, 128, %s %s, tokens[0], tokens[1]);
@@ -1056,7 +1056,7 @@
snprintf(icon, 2048, IMG border=\0\ SRC=\%s\ ALT=\%-6s\,
mimeGetIconURL(parts-name),
[FILE]);
-snprintf(size, 2048, %6dk, parts-size);
+snprintf(size, 2048, %6PRId64k, parts-size);
break;
}
@@ -1619,7 +1619,7 @@
}
wordlist *
-FtpStateData::ftpParseControlReply(char *buf, size_t len, int *codep, int *used)
+FtpStateData::ftpParseControlReply(char *buf, size_t len, int *codep, size_t *used)
{
char *s;
char *sbuf;
@@ -1629,7 +1629,7 @@
wordlist *head = NULL;
wordlist *list;
wordlist **tail = head;
-off_t offset;
+size_t offset;
size_t linelen;
int code = -1;
debug(9, 5) (ftpParseControlReply\n);
@@ -1755,11 +1755,7 @@
return;
}
-/*
- * Cast is necessary because off_t and size_t are not always of
- * same signedness.
- */
-assert(ftpState-ctrl.offset (off_t) ftpState-ctrl.size);
+assert(ftpState-ctrl.offset ftpState-ctrl.size);
if (errflag == COMM_OK len 0) {
fd_bytes(fd, len, FD_READ);
@@ -1802,7 +1798,7 @@
FtpStateData::handleControlReply()
{
wordlist **W;
-int bytes_used = 0;
+size_t bytes_used = 0;
wordlistDestroy(ctrl.message);
ctrl.message = ftpParseControlReply(ctrl.buf,
ctrl.offset, ctrl.replycode, bytes_used);
@@ -1810,7 +1806,7 @@
if (ctrl.message == NULL) {