diff options
author | Dmitry Sivachenko <demon@FreeBSD.org> | 2002-10-14 06:57:24 +0000 |
---|---|---|
committer | Dmitry Sivachenko <demon@FreeBSD.org> | 2002-10-14 06:57:24 +0000 |
commit | 16f1f17d6747a939e6133701469df5ee7a87c621 (patch) | |
tree | 2e231f4723b9e41d47368ae15f114f74295fb489 /net/xferstats/files/patch-ac | |
parent | Update the port to squid-2.5.stable1. (diff) |
Upgrade port to version 2.16;
Add three patches:
patch-aa: If you use CHUNK_INPUT without this patch, you end up with many
error messages xferstats in free(): warning: modified (chunk-) pointer
(or you may want to fix chunks...)
patch-ab: If number of "Files Transmitted" is divisible by CHUNK_INPUT
without this patch, you end up with error "No data to process." instead
of results.
patch-ac: Typical beginner's bug in C: feof() is used before read function,
where its result is not tested then. Without this patch the last line
is counted twice.
PR: 44015
Submitted by: Cejka Rudolf <cejkar@fit.vutbr.cz>
Notes
Notes:
svn path=/head/; revision=68010
Diffstat (limited to '')
-rw-r--r-- | net/xferstats/files/patch-ac | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/net/xferstats/files/patch-ac b/net/xferstats/files/patch-ac new file mode 100644 index 000000000000..6a0da013c765 --- /dev/null +++ b/net/xferstats/files/patch-ac @@ -0,0 +1,84 @@ +--- parselog.c.orig Sun Oct 13 17:39:55 2002 ++++ parselog.c Sun Oct 13 17:42:12 2002 +@@ -202,15 +202,11 @@ + + while (1) { + if (pointers->config->use_stdin) { +- if (feof(stdin)) ++ if (fgets(foo, sizeof(foo), stdin) == NULL) + break; +- /* there's probably a better way to do this :) */ +- fgets(foo, sizeof(foo), stdin); + } else { +- if (feof(log_stream)) ++ if (fgets(foo, sizeof(foo), log_stream) == NULL) + break; +- +- fgets(foo, sizeof(foo), log_stream); + } + + if ((len = strlen(foo)) < 42) +@@ -455,10 +451,8 @@ + #ifdef HAVE_MMAP + if (pointers->config->use_stdin) + { +- if (feof(stdin)) ++ if (fgets(foo, sizeof(foo), stdin) == NULL) + break; +- /* there's probably a better way to do this :) */ +- fgets(foo, sizeof(foo), stdin); + } + else + { +@@ -497,17 +491,13 @@ + #else /* HAVE_MMAP */ + if (pointers->config->use_stdin) + { +- if (feof(stdin)) ++ if (fgets(foo, sizeof(foo), stdin) == NULL) + break; +- /* there's probably a better way to do this :) */ +- fgets(foo, sizeof(foo), stdin); + } + else + { +- if (feof(log_stream)) ++ if (fgets(foo, sizeof(foo), log_stream) == NULL) + break; +- +- fgets(foo, sizeof(foo), log_stream); + } + #endif /* HAVE_MMAP */ + +@@ -770,10 +760,8 @@ + #ifdef HAVE_MMAP + if (pointers->config->use_stdin) + { +- if (feof(stdin)) ++ if (fgets(foo, sizeof(foo), stdin) == NULL) + break; +- /* there's probably a better way to do this :) */ +- fgets(foo, 2047, stdin); + } + else + { +@@ -812,17 +800,13 @@ + #else /* HAVE_MMAP */ + if (pointers->config->use_stdin) + { +- if (feof(stdin)) ++ if (fgets(foo, sizeof(foo), stdin) == NULL) + break; +- /* there's probably a better way to do this :) */ +- fgets(foo, 2047, stdin); + } + else + { +- if (feof(log_stream)) ++ if (fgets(foo, sizeof(foo), log_stream) == NULL) + break; +- +- fgets(foo, sizeof(foo), log_stream); + } + #endif /* HAVE_MMAP */ + |