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 -0000 1.1
+++ PeerDigest.h 28 Apr 2007 21:07:51 -0000
@@ -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 -0000 1.6.6.1
+++ fde.cc 28 Apr 2007 21:08:02 -0000
@@ -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 %7"PRId64"%c %7"PRId64"%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 %7"PRId64"%c %7"PRId64"%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 -0000 1.13
+++ fde.h 28 Apr 2007 21:08:02 -0000
@@ -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 -0000 1.63.2.8
+++ ftp.cc 28 Apr 2007 21:08:14 -0000
@@ -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, " %6"PRId64"k", 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) {
/* didn't get complete reply yet */
- if (ctrl.offset == (off_t) ctrl.size) {
+ if (ctrl.offset == ctrl.size) {
ctrl.buf = (char *)memReallocBuf(ctrl.buf, ctrl.size << 1, &ctrl.size);
}
Index: mime.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/mime.cc,v
retrieving revision 1.22.6.1
diff -u -r1.22.6.1 mime.cc
--- mime.cc 23 Apr 2007 06:19:32 -0000 1.22.6.1
+++ mime.cc 28 Apr 2007 21:08:25 -0000
@@ -586,7 +586,7 @@
HttpVersion version(1, 0);
reply->setHeaders(version, HTTP_OK, NULL,
- mimeGetContentType(icon), (int) sb.st_size, sb.st_mtime, -1);
+ mimeGetContentType(icon), (int64_t) sb.st_size, sb.st_mtime, -1);
reply->cache_control = httpHdrCcCreate();
Index: peer_digest.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/peer_digest.cc,v
retrieving revision 1.27.6.1
diff -u -r1.27.6.1 peer_digest.cc
--- peer_digest.cc 23 Apr 2007 06:19:33 -0000 1.27.6.1
+++ peer_digest.cc 28 Apr 2007 21:08:35 -0000
@@ -784,7 +784,7 @@
if (!reason && !size) {
if (!pd->cd)
reason = "null digest?!";
- else if (fetch->mask_offset != (off_t)pd->cd->mask_size)
+ else if (fetch->mask_offset != (int64_t)pd->cd->mask_size)
reason = "premature end of digest?!";
else if (!peerDigestUseful(pd))
reason = "useless digest";
Index: stat.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/stat.cc,v
retrieving revision 1.36.4.1
diff -u -r1.36.4.1 stat.cc
--- stat.cc 23 Apr 2007 06:19:33 -0000 1.36.4.1
+++ stat.cc 28 Apr 2007 21:08:50 -0000
@@ -1658,7 +1658,7 @@
if (conn != NULL) {
fd = conn->fd;
- storeAppendPrintf(s, "\tFD %d, read %d, wrote %d\n", fd,
+ storeAppendPrintf(s, "\tFD %d, read %"PRId64", wrote %"PRId64"\n", fd,
fd_table[fd].bytes_read, fd_table[fd].bytes_written);
storeAppendPrintf(s, "\tFD desc: %s\n", fd_table[fd].desc);
storeAppendPrintf(s, "\tin: buf %p, offset %ld, size %ld\n",