File: patch03

package info (click to toggle)
http-analyze 2.4-2.1
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 3,344 kB
  • ctags: 924
  • sloc: ansic: 11,678; perl: 241; sh: 215; makefile: 214
file content (205 lines) | stat: -rw-r--r-- 7,979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
--- 2.4.1.2	1999/11/02 11:16:04
+++ 2.4.1.3	1999/11/04 12:15:19
@@ -1,4 +1,4 @@
-static char rcs_id[] = "$Id: http-analyze.c,v 2.4.1.2 1999/11/02 11:16:04 stefan Stab $";
+static char rcs_id[] = "$Id: http-analyze.c,v 2.4.1.3 1999/11/04 12:15:19 stefan Stab $";
 
 /*
 *************************************************************************
@@ -491,7 +491,7 @@
 static int use_vrml = 0;		/* create a VRML model */
 static int use_frames = 0;		/* if set create frames interface */
 static int use_hist = 0;		/* if set use values from history for expired period */
-static int autohide = 0;		/* if set automatically add base as hidden item for each URL */
+static int noautohide = 0;		/* if set don't automatically add base URLs as hidden items */
 static int nohist = 0;			/* if set ignore history file */
 static int nodefhid = 0;		/* if set don't collect image filenames */
 static int nocgistrip = 0;		/* if set don't strip arguments from CGI URLs */
@@ -1007,7 +1007,7 @@
 		  case 'e':	use_hist++;	 break;	/* use values from history */
 		  case 'f':	use_frames++;	 break;	/* generate also HTML frames */
 		  case 'g':	nonavpanel++;	 break;	/* don't create navigation panel */
-		  case 'k':	autohide++;	 break;	/* automatically add base as hidden item for each URL */
+		  case 'k':	noautohide++;	 break;	/* don't automatically add base URLs as hidden items */
 		  case 'n':	nohist++;	 break;	/* don't use history */
 		  case 'q':	nocgistrip++;	 break;	/* don't strip CGI arguments */
 		  case 'v':	verbose++;	 break;	/* be verbose */
@@ -1923,7 +1923,7 @@
 				np = lookupItem(urltab, &entry->request, entry->reqbase.len);
 				if (np == NULL || !np->cnt.hits) {	/* no mem or brand new */
 					uniq_urls++;
-					if (autohide && entry->reqbase.len)
+					if (!noautohide && entry->reqbase.len)
 						saveHiddenItem(HIDDEN_ITEMS, &entry->reqbase);
 				}
 
@@ -3453,7 +3453,7 @@
 		    buttons[(which)].wid, buttons[(which)].ht)
 
 	/*CONSTCOND*/
-	MAKE_BUTTON(1, BTN_YEAR, 1);
+	MAKE_BUTTON(1, BTN_YEAR, 1);	/* controlling expression is intentionally constant */
 	prString(ofp, NULL, FONT_HEAD2, NULL, NULL, NULL);
 	(void) fprintf(ofp, "<SELECT NAME=\"period\" onChange=\"loadMonth();\">\n"
 		"<OPTION SELECTED>%.3s %4d\n", monnam[idx], t.end.year);
@@ -3471,9 +3471,9 @@
 	(void) fprintf(ofp, "</SELECT>%s<BR>\n", FONT_END(FONT_VAR));
 
 	/*CONSTCOND*/
-	MAKE_BUTTON(2,  BTN_TOTALS, 1);
+	MAKE_BUTTON(2,  BTN_TOTALS, 1);	/* controlling expression is intentionally constant */
 	/*CONSTCOND*/
-	MAKE_BUTTON(3,  BTN_DAYS,   1);
+	MAKE_BUTTON(3,  BTN_DAYS,   1);	/* controlling expression is intentionally constant */
 	MAKE_BUTTON(4,  BTN_AVLOAD, sptab[SP_AVLOAD].ison);
 	MAKE_BUTTON(5,  BTN_TOPURL, lntab[FNAME_TOPFILES] != 0);
 	MAKE_BUTTON(6,  BTN_TOPDOM, lntab[FNAME_TOPSITES] != 0);
@@ -3597,7 +3597,7 @@
 #endif
 
 static void prLinks(FILE *const ofp, char *const title, char *const dpfx) {
-	char fname[MAX_FNAMELEN];
+	char fname[MAX_FNAMELEN], gname[MAX_FNAMELEN];
 	char period[SMALLSIZE];
 	int idx = (int)t.current.year;
 	int rc = 0;
@@ -3610,6 +3610,11 @@
 		(void) snprintf(fname, sizeof fname, "%s%04d", dpfx, idx);
 		if (access(fname, F_OK) == 0) {
 			rc++;
+			(void) snprintf(gname, sizeof gname, "%s/gr-icon" IMG_SFX, fname);
+#if !defined(OLD_GDLIB)
+			if (access(gname, F_OK) != 0)
+				(void) snprintf(gname, sizeof gname, "%s/gr-icon.gif", fname);
+#endif
 			if (idx == (int)t.current.year)
 				(void) snprintf(period, sizeof period, "%s",
 					GETMSG(191, "the last 12 months"));
@@ -3617,10 +3622,10 @@
 
 			(void) fprintf(ofp,
 				"<TR><TD BGCOLOR=\"#CCCCCC\" ALIGN=\"CENTER\" VALIGN=\"MIDDLE\">"
-				"<A HREF=\"%s/index.html\"><IMG SRC=\"%s/gr-icon" IMG_SFX "\""
+				"<A HREF=\"%s/index.html\"><IMG SRC=\"%s\""
 				" WIDTH=\"59\" HEIGHT=\"41\" ALT=\"\" BORDER=\"0\"></A></TD>\n"
 				"<TD BGCOLOR=\"#CCCCCC\" ALIGN=\"LEFT\" VALIGN=\"MIDDLE\">\n"
-				"<A HREF=\"%s/index.html\"", fname, fname, fname);
+				"<A HREF=\"%s/index.html\"", fname, gname, fname);
 			if (!nonavpanel)
 				(void) fprintf(ofp,
 					" onClick=\"createWin('%s/jsnav.html',"
@@ -4080,7 +4085,7 @@
 		return ((*(NLIST **)e2)->cnt.hits < (*(NLIST **)e1)->cnt.hits) ? -1 : 1;
 	}
 	if (ip[stamp1].col->cnt.hits == ip[stamp2].col->cnt.hits)
-		return stamp2 - stamp1;
+		return (stamp2 < stamp1) ? -1 : 1;
 	return (ip[stamp2].col->cnt.hits < ip[stamp1].col->cnt.hits) ? -1 : 1;
 }
 
@@ -4098,7 +4103,7 @@
 		return ((*(NLIST **)e2)->cnt.hits < (*(NLIST **)e1)->cnt.hits) ? -1 : 1;
 	}
 	if (ip[stamp1].col->cnt.hits == ip[stamp2].col->cnt.hits)
-		return stamp2 < stamp1 ? -1 : 1;
+		return (stamp2 < stamp1) ? -1 : 1;
 	return (ip[stamp2].col->cnt.hits < ip[stamp1].col->cnt.hits) ? -1 : 1;
 }
 
@@ -4127,7 +4132,7 @@
 		return ((*(NLIST **)e2)->cnt.hits < (*(NLIST **)e1)->cnt.hits) ? -1 : 1;
 	}
 	if (ip[stamp1].col->cnt.hits == ip[stamp2].col->cnt.hits)
-		return stamp2 < stamp1 ? -1 : 1;
+		return (stamp2 < stamp1) ? -1 : 1;
 	return (ip[stamp2].col->cnt.hits < ip[stamp1].col->cnt.hits) ? -1 : 1;
 }
 
@@ -4145,15 +4150,18 @@
 		return ((*(NLIST **)e2)->cnt.hits < (*(NLIST **)e1)->cnt.hits) ? -1 : 1;
 	}
 	if (ip[stamp1].col->cnt.hits == ip[stamp2].col->cnt.hits)
-		return stamp2 < stamp1 ? -1 : 1;
+		return (stamp2 < stamp1) ? -1 : 1;
 	return (ip[stamp2].col->cnt.hits < ip[stamp1].col->cnt.hits) ? -1 : 1;
 }
 
 /*
-** Sort list by internal country code.
+** Sort country list by number of hits.
 */
 static int sort_by_cntry(const void *e1, const void *e2) {
-	return ((*(COUNTRY **)e2)->cnt.hits - (*(COUNTRY **)e1)->cnt.hits);
+	if ((*(COUNTRY **)e2)->cnt.hits == (*(COUNTRY **)e1)->cnt.hits)
+		return 0;
+
+	return ((*(COUNTRY **)e2)->cnt.hits < (*(COUNTRY **)e1)->cnt.hits) ? -1 : 1;
 }
 
 /*
@@ -4175,7 +4183,7 @@
 */
 static int sort_by_slen(const void *e1, const void *e2) {
 	if (((ITEM_LIST *)e1)->len != ((ITEM_LIST *)e2)->len)
-		return ((ITEM_LIST *)e1)->len - ((ITEM_LIST *)e2)->len;
+		return (((ITEM_LIST *)e1)->len < ((ITEM_LIST *)e2)->len) ? -1 : 1;
 
 	return msiis_mode ?
 		strcasecmp(((ITEM_LIST *)e1)->pfx, ((ITEM_LIST *)e2)->pfx) :
@@ -4189,12 +4197,12 @@
 	if (((TOP_COUNTER *)e2)->cnt.hits == ((TOP_COUNTER *)e1)->cnt.hits) {
 		if (((TOP_COUNTER *)e2)->cnt.bytes > ((TOP_COUNTER *)e1)->cnt.bytes)
 			return 1;
-		else if (((TOP_COUNTER *)e2)->cnt.bytes > ((TOP_COUNTER *)e1)->cnt.bytes)
+		else if (((TOP_COUNTER *)e2)->cnt.bytes < ((TOP_COUNTER *)e1)->cnt.bytes)
 			return -1;
 		else
 			return 0;
 	}
-	return ((TOP_COUNTER *)e2)->cnt.hits < ((TOP_COUNTER *)e1)->cnt.hits ? -1 : 1;
+	return (((TOP_COUNTER *)e2)->cnt.hits < ((TOP_COUNTER *)e1)->cnt.hits) ? -1 : 1;
 }
 
 /*
@@ -4242,7 +4250,7 @@
 	avg_day.nomod /= ndays;
 	avg_day.views /= ndays;
 	avg_day.sessions /= ndays;
-	avg_day.bytes /= ndays;
+	avg_day.bytes /= (float)ndays;
 
 	if (max_day.bytes < 1024.0)
 		max_day.bytes = 1024.0;
--- 2.4.1.2	1999/11/02 11:10:28
+++ 2.4.1.3	1999/11/04 12:15:02
@@ -1 +1 @@
-#define PATCHLEVEL	2
+#define PATCHLEVEL	3
--- 1.23	1999/11/01 18:08:35
+++ CHANGES	1999/11/04 12:25:53
@@ -2,6 +2,25 @@
 =================================================
 
 --------------------------------------------------------------------------
+Changes in version 2.4pl3 / November, 3rd 1999
+--------------------------------------------------------------------------
+
+Bug fixes:
+        o Added code to link to the GIF versions of the graph icons
+	  if no PNG version is available.
+
+	o Fixed a bug in the sorting routines.
+
+
+--------------------------------------------------------------------------
+Changes in version 2.4pl2 / November, 2nd 1999
+--------------------------------------------------------------------------
+
+Enhancements:
+        o Added messages 187 and 188, corrected GD license terms.
+
+
+--------------------------------------------------------------------------
 Changes in version 2.4pl1 / November, 1st 1999
 --------------------------------------------------------------------------