---------------------
PatchSet 6456
Date: 2005/03/03 00:11:55
Author: hno
Branch: lfs-2_5
Tag: (none)
Log:
lfs fixes.
Members:
src/HttpHeader.c:1.10.6.19.2.1->1.10.6.19.2.2
src/MemBuf.c:1.5.30.2->1.5.30.2.8.1
src/Packer.c:1.4->1.4.126.1
src/ftp.c:1.18.6.18.2.1->1.18.6.18.2.2
src/http.c:1.17.6.26.2.1->1.17.6.26.2.2
src/protos.h:1.41.6.22.2.1->1.41.6.22.2.2
src/structs.h:1.48.2.33.2.1->1.48.2.33.2.2
src/typedefs.h:1.25.6.6.8.1->1.25.6.6.8.2
Index: squid/src/HttpHeader.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/HttpHeader.c,v
retrieving revision 1.10.6.19.2.1
retrieving revision 1.10.6.19.2.2
diff -u -r1.10.6.19.2.1 -r1.10.6.19.2.2
--- squid/src/HttpHeader.c 25 Feb 2005 10:48:45 -0000 1.10.6.19.2.1
+++ squid/src/HttpHeader.c 3 Mar 2005 00:11:55 -0000 1.10.6.19.2.2
@@ -1,6 +1,6 @@
/*
- * $Id: HttpHeader.c,v 1.10.6.19.2.1 2005/02/25 10:48:45 hno Exp $
+ * $Id: HttpHeader.c,v 1.10.6.19.2.2 2005/03/03 00:11:55 hno Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
@@ -80,7 +80,7 @@
{"Content-Disposition", HDR_CONTENT_DISPOSITION, ftStr},
{"Content-Encoding", HDR_CONTENT_ENCODING, ftStr},
{"Content-Language", HDR_CONTENT_LANGUAGE, ftStr},
- {"Content-Length", HDR_CONTENT_LENGTH, ftInt},
+ {"Content-Length", HDR_CONTENT_LENGTH, ftSize},
{"Content-Location", HDR_CONTENT_LOCATION, ftStr},
{"Content-MD5", HDR_CONTENT_MD5, ftStr}, /* for now */
{"Content-Range", HDR_CONTENT_RANGE, ftPContRange},
@@ -930,7 +930,7 @@
off_t value = -1;
int ok;
assert_eid(id);
- assert(Headers[id].type == ftInt); /* must be of an appropriate type */
+ assert(Headers[id].type == ftSize); /* must be of an appropriate type */
if ((e = httpHeaderFindEntry(hdr, id))) {
ok = httpHeaderParseSize(strBuf(e->value), &value);
httpHeaderNoteParsedEntry(e->id, e->value, !ok);
Index: squid/src/MemBuf.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/MemBuf.c,v
retrieving revision 1.5.30.2
retrieving revision 1.5.30.2.8.1
diff -u -r1.5.30.2 -r1.5.30.2.8.1
--- squid/src/MemBuf.c 6 Oct 2004 02:15:11 -0000 1.5.30.2
+++ squid/src/MemBuf.c 3 Mar 2005 00:11:55 -0000 1.5.30.2.8.1
@@ -1,6 +1,6 @@
/*
- * $Id: MemBuf.c,v 1.5.30.2 2004/10/06 02:15:11 squidadm Exp $
+ * $Id: MemBuf.c,v 1.5.30.2.8.1 2005/03/03 00:11:55 hno Exp $
*
* DEBUG: section 59 auto-growing Memory Buffer with printf
* AUTHOR: Alex Rousskov
@@ -192,7 +192,7 @@
/* calls memcpy, appends exactly size bytes, extends buffer if needed */
void
-memBufAppend(MemBuf * mb, const char *buf, mb_size_t sz)
+memBufAppend(MemBuf * mb, const char *buf, int sz)
{
assert(mb && buf && sz >= 0);
assert(mb->buf);
Index: squid/src/Packer.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/Packer.c,v
retrieving revision 1.4
retrieving revision 1.4.126.1
diff -u -r1.4 -r1.4.126.1
--- squid/src/Packer.c 12 Jan 2001 08:20:32 -0000 1.4
+++ squid/src/Packer.c 3 Mar 2005 00:11:55 -0000 1.4.126.1
@@ -1,6 +1,6 @@
/*
- * $Id: Packer.c,v 1.4 2001/01/12 08:20:32 hno Exp $
+ * $Id: Packer.c,v 1.4.126.1 2005/03/03 00:11:55 hno Exp $
*
* DEBUG: section 60 Packer: A uniform interface to store-like modules
* AUTHOR: Alex Rousskov
@@ -93,7 +93,7 @@
/* append()'s */
static void (*const store_append) (StoreEntry *, const char *, int) = &storeAppend;
-static void (*const memBuf_append) (MemBuf *, const char *, mb_size_t) = &memBufAppend;
+static void (*const memBuf_append) (MemBuf *, const char *, int) = &memBufAppend;
/* vprintf()'s */
static void (*const store_vprintf) (StoreEntry *, const char *, va_list ap) = &storeAppendVPrintf;
@@ -109,7 +109,7 @@
assert(p && e);
p->append = (append_f) store_append;
p->vprintf = (vprintf_f) store_vprintf;
- p->real_handler = e;
+ p->real_handle = e;
}
/* init with this to accumulate data in MemBuf */
@@ -119,7 +119,7 @@
assert(p && mb);
p->append = (append_f) memBuf_append;
p->vprintf = (vprintf_f) memBuf_vprintf;
- p->real_handler = mb;
+ p->real_handle = mb;
}
/* call this when you are done */
@@ -130,15 +130,15 @@
/* it is not really necessary to do this, but, just in case... */
p->append = NULL;
p->vprintf = NULL;
- p->real_handler = NULL;
+ p->real_handle = NULL;
}
void
packerAppend(Packer * p, const char *buf, int sz)
{
assert(p);
- assert(p->real_handler && p->append);
- p->append(p->real_handler, buf, sz);
+ assert(p->real_handle && p->append);
+ p->append(p->real_handle, buf, sz);
}
#if STDC_HEADERS
@@ -161,7 +161,7 @@
fmt = va_arg(args, char *);
#endif
assert(p);
- assert(p->real_handler && p->vprintf);
- p->vprintf(p->real_handler, fmt, args);
+ assert(p->real_handle && p->vprintf);
+ p->vprintf(p->real_handle, fmt, args);
va_end(args);
}
Index: squid/src/ftp.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v
retrieving revision 1.18.6.18.2.1
retrieving revision 1.18.6.18.2.2
diff -u -r1.18.6.18.2.1 -r1.18.6.18.2.2
--- squid/src/ftp.c 25 Feb 2005 10:48:49 -0000 1.18.6.18.2.1
+++ squid/src/ftp.c 3 Mar 2005 00:11:55 -0000 1.18.6.18.2.2
@@ -1,6 +1,6 @@
/*
- * $Id: ftp.c,v 1.18.6.18.2.1 2005/02/25 10:48:49 hno Exp $
+ * $Id: ftp.c,v 1.18.6.18.2.2 2005/03/03 00:11:55 hno Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
@@ -566,7 +566,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]);
p->date = xstrdup(tbuf);
@@ -604,7 +604,7 @@
p->name = xstrndup(ct + 1, l + 1);
break;
case 's':
- p->size = atoi(ct + 1);
+ p->size = strtoll(ct + 1, NULL, 10);
break;
case 'm':
t = (time_t) strtoll(ct + 1, &tmp, 0);
@@ -728,8 +728,6 @@
ftpListPartsFree(&parts);
return html;
}
- parts->size += 1023;
- parts->size >>= 10;
parts->showname = xstrdup(parts->name);
if (!Config.Ftp.list_wrap) {
if (strlen(parts->showname) > width - 1) {
@@ -771,10 +769,26 @@
break;
case '-':
default:
- snprintf(icon, 2048, "",
- mimeGetIconURL(parts->name),
- "[FILE]");
- snprintf(size, 2048, " %6"PRINTF_OFF_T"k", parts->size);
+ {
+ off_t sz = parts->size;
+ char units = ' ';
+ snprintf(icon, 2048, "",
+ mimeGetIconURL(parts->name),
+ "[FILE]");
+ if (sz > 10 * 1024 ) {
+ sz = (sz + 1023) >> 10;
+ units = 'K';
+ }
+ if (sz > 10 * 1024 ) {
+ sz = (sz + 1023) >> 10;
+ units = 'M';
+ }
+ if (sz > 10 * 1024 ) {
+ sz = (sz + 1023) >> 10;
+ units = 'G';
+ }
+ snprintf(size, 2048, " %6"PRINTF_OFF_T"%c", sz, units);
+ }
break;
}
if (parts->type != 'd') {
@@ -1698,7 +1712,7 @@
debug(9, 3) ("This is ftpReadSize\n");
if (code == 213) {
ftpUnhack(ftpState);
- ftpState->size = (size_t)strtoll(ftpState->ctrl.last_reply, NULL, 10);
+ ftpState->size = (off_t)strtoll(ftpState->ctrl.last_reply, NULL, 10);
if (ftpState->size == 0) {
debug(9, 2) ("ftpReadSize: SIZE reported %s on %s\n",
ftpState->ctrl.last_reply,
Index: squid/src/http.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/http.c,v
retrieving revision 1.17.6.26.2.1
retrieving revision 1.17.6.26.2.2
diff -u -r1.17.6.26.2.1 -r1.17.6.26.2.2
--- squid/src/http.c 25 Feb 2005 10:48:50 -0000 1.17.6.26.2.1
+++ squid/src/http.c 3 Mar 2005 00:11:55 -0000 1.17.6.26.2.2
@@ -1,6 +1,6 @@
/*
- * $Id: http.c,v 1.17.6.26.2.1 2005/02/25 10:48:50 hno Exp $
+ * $Id: http.c,v 1.17.6.26.2.2 2005/03/03 00:11:55 hno Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
@@ -1059,7 +1059,7 @@
/* build request prefix and append it to a given MemBuf;
* return the length of the prefix */
-mb_size_t
+int
httpBuildRequestPrefix(request_t * request,
request_t * orig_request,
StoreEntry * entry,
Index: squid/src/protos.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/protos.h,v
retrieving revision 1.41.6.22.2.1
retrieving revision 1.41.6.22.2.2
diff -u -r1.41.6.22.2.1 -r1.41.6.22.2.2
--- squid/src/protos.h 25 Feb 2005 10:48:51 -0000 1.41.6.22.2.1
+++ squid/src/protos.h 3 Mar 2005 00:11:56 -0000 1.41.6.22.2.2
@@ -1,6 +1,6 @@
/*
- * $Id: protos.h,v 1.41.6.22.2.1 2005/02/25 10:48:51 hno Exp $
+ * $Id: protos.h,v 1.41.6.22.2.2 2005/03/03 00:11:56 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
@@ -303,7 +303,7 @@
/* http.c */
extern int httpCachable(method_t);
extern void httpStart(FwdState *);
-extern mb_size_t httpBuildRequestPrefix(request_t * request,
+extern int httpBuildRequestPrefix(request_t * request,
request_t * orig_request,
StoreEntry * entry,
MemBuf * mb,
@@ -609,7 +609,7 @@
/* unfirtunate hack to test if the buffer has been Init()ialized */
extern int memBufIsNull(MemBuf * mb);
/* calls memcpy, appends exactly size bytes, extends buffer if needed */
-extern void memBufAppend(MemBuf * mb, const char *buf, mb_size_t size);
+extern void memBufAppend(MemBuf * mb, const char *buf, int size);
/* calls snprintf, extends buffer if needed */
#if STDC_HEADERS
extern void
Index: squid/src/structs.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/structs.h,v
retrieving revision 1.48.2.33.2.1
retrieving revision 1.48.2.33.2.2
diff -u -r1.48.2.33.2.1 -r1.48.2.33.2.2
--- squid/src/structs.h 25 Feb 2005 10:48:52 -0000 1.48.2.33.2.1
+++ squid/src/structs.h 3 Mar 2005 00:11:57 -0000 1.48.2.33.2.2
@@ -1,6 +1,6 @@
/*
- * $Id: structs.h,v 1.48.2.33.2.1 2005/02/25 10:48:52 hno Exp $
+ * $Id: structs.h,v 1.48.2.33.2.2 2005/03/03 00:11:57 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
@@ -849,7 +849,7 @@
/* protected, use interface functions instead */
append_f append;
vprintf_f vprintf;
- void *real_handler; /* first parameter to real append and vprintf */
+ void *real_handle; /* first parameter to real append and vprintf */
};
/* http status line */
Index: squid/src/typedefs.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/typedefs.h,v
retrieving revision 1.25.6.6.8.1
retrieving revision 1.25.6.6.8.2
diff -u -r1.25.6.6.8.1 -r1.25.6.6.8.2
--- squid/src/typedefs.h 25 Feb 2005 10:48:52 -0000 1.25.6.6.8.1
+++ squid/src/typedefs.h 3 Mar 2005 00:11:57 -0000 1.25.6.6.8.2
@@ -1,6 +1,6 @@
/*
- * $Id: typedefs.h,v 1.25.6.6.8.1 2005/02/25 10:48:52 hno Exp $
+ * $Id: typedefs.h,v 1.25.6.6.8.2 2005/03/03 00:11:57 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
@@ -322,7 +322,7 @@
typedef const char *AUTHSCONNLASTHEADER(auth_user_request_t *);
/* append/vprintf's for Packer */
-typedef void (*append_f) (void *, const char *buf, int size);
+typedef void (*append_f) (void *, const char *buf, size_t size);
#if STDC_HEADERS
typedef void (*vprintf_f) (void *, const char *fmt, va_list args);
#else
@@ -336,7 +336,7 @@
typedef int Ctx;
/* in case we want to change it later */
-typedef off_t mb_size_t;
+typedef int mb_size_t;
/* iteration for HttpHdrRange */
typedef int HttpHdrRangePos;