You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rs...@locus.apache.org on 2000/03/01 10:13:40 UTC
cvs commit: apache-1.3/src/modules/standard mod_negotiation.c mod_rewrite.c
rse 00/03/01 01:13:40
Modified: src CHANGES buildmark.c
src/include ap_config.h
src/lib/expat-lite xmlparse.c
src/main http_config.c util.c util_md5.c
src/modules/example mod_example.c
src/modules/proxy mod_proxy.c proxy_cache.c proxy_util.c
src/modules/standard mod_negotiation.c mod_rewrite.c
Log:
We all know that SGI's 10x patches are not acceptable as a whole to
be included into Apache 1.3. But no one seems to have recognized that
Mike Abbott's changes also included very reasonable and good cleanup
changes. So I investigated two hours this morning and extracted those
non-performance related changes from the 512KB 10xpatch-1.3.11-0 patch
and merged them into 1.3. Here is the CHANGES entry:
| Merged in a small subset of SGI's latest `10x' patchkit for Apache
| 1.3.11. The extracted and merged in parts are entirely cleanup and
| non-performance related changes only. SGI's remaining changes are
| not taken over, because they are either cluttering the Apache 1.3
| sources too much (e.g. the lint(1) related changes) or cause too
| much internal changes (e.g. the ap_int32 types, etc.) which are not
| reasonable to do any longer for Apache 1.3 (they should be done for
| Apache 2.0 instead).
Submitted by: Mike Abbott <mj...@sgi.com>
Extracted and merged in by: Ralf S. Engelschall
Reviewed by: Ralf S. Engelschall
Revision Changes Path
1.1521 +10 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1520
retrieving revision 1.1521
diff -u -r1.1520 -r1.1521
--- CHANGES 2000/02/29 14:24:26 1.1520
+++ CHANGES 2000/03/01 09:13:34 1.1521
@@ -1,5 +1,15 @@
Changes with Apache 1.3.13
+ *) Merged in a small subset of SGI's latest `10x' patchkit for Apache
+ 1.3.11. The extracted and merged in parts are entirely cleanup and
+ non-performance related changes only. SGI's remaining changes are
+ not taken over, because they are either cluttering the Apache 1.3
+ sources too much (e.g. the lint(1) related changes) or cause too
+ much internal changes (e.g. the ap_int32 types, etc.) which are not
+ reasonable to do any longer for Apache 1.3 (they should be done for
+ Apache 2.0 instead).
+ [Mike Abbott <mj...@sgi.com>, Ralf S. Engelschall]
+
*) Fixes to mod_proxy for BeOS support.
[David Reid <dr...@jetnet.co.uk>]
1.10 +1 -1 apache-1.3/src/buildmark.c
Index: buildmark.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/buildmark.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- buildmark.c 1999/01/01 19:04:35 1.9
+++ buildmark.c 2000/03/01 09:13:35 1.10
@@ -64,7 +64,7 @@
static const char server_built[] = "unknown";
#endif
-API_EXPORT(const char *) ap_get_server_built()
+API_EXPORT(const char *) ap_get_server_built(void)
{
return server_built;
}
1.285 +1 -1 apache-1.3/src/include/ap_config.h
Index: ap_config.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/ap_config.h,v
retrieving revision 1.284
retrieving revision 1.285
diff -u -r1.284 -r1.285
--- ap_config.h 2000/02/29 14:24:27 1.284
+++ ap_config.h 2000/03/01 09:13:36 1.285
@@ -1406,7 +1406,7 @@
void syslog(int, char *,...);
char *mktemp(char *);
-long vfprintf(FILE *, const char *, va_list);
+int vfprintf(FILE *, const char *, va_list);
#endif /* SUNOS_LIB_PROTOTYPES */
1.4 +0 -1 apache-1.3/src/lib/expat-lite/xmlparse.c
Index: xmlparse.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/lib/expat-lite/xmlparse.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xmlparse.c 2000/01/14 09:03:49 1.3
+++ xmlparse.c 2000/03/01 09:13:36 1.4
@@ -2411,7 +2411,6 @@
if (!poolAppend(pool, enc, ptr, next))
return XML_ERROR_NO_MEMORY;
break;
- break;
case XML_TOK_TRAILING_CR:
next = ptr + enc->minBytesPerChar;
/* fall through */
1.151 +3 -3 apache-1.3/src/main/http_config.c
Index: http_config.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_config.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -r1.150 -r1.151
--- http_config.c 2000/01/15 16:40:42 1.150
+++ http_config.c 2000/03/01 09:13:37 1.151
@@ -679,7 +679,7 @@
*m = NULL;
}
-void ap_setup_prelinked_modules()
+void ap_setup_prelinked_modules(void)
{
module **m;
module **m2;
@@ -1616,7 +1616,7 @@
* the directive arguments, in what module they are handled, and in
* what parts of the configuration they are allowed. Used for httpd -h.
*/
-void ap_show_directives()
+void ap_show_directives(void)
{
const command_rec *pc;
int n;
@@ -1631,7 +1631,7 @@
}
/* Show the preloaded module names. Used for httpd -l. */
-void ap_show_modules()
+void ap_show_modules(void)
{
int n;
1.181 +2 -2 apache-1.3/src/main/util.c
Index: util.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/util.c,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -r1.180 -r1.181
--- util.c 2000/02/23 12:44:57 1.180
+++ util.c 2000/03/01 09:13:37 1.181
@@ -108,7 +108,7 @@
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
-API_EXPORT(char *) ap_get_time()
+API_EXPORT(char *) ap_get_time(void)
{
time_t t;
char *time_string;
@@ -1695,7 +1695,7 @@
return 1;
}
#endif
- return (finfo->st_mode & S_IXOTH);
+ return ((finfo->st_mode & S_IXOTH) != 0);
#endif
}
1.20 +0 -4 apache-1.3/src/main/util_md5.c
Index: util_md5.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/util_md5.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- util_md5.c 1999/04/09 12:57:07 1.19
+++ util_md5.c 2000/03/01 09:13:37 1.20
@@ -193,12 +193,10 @@
{
AP_MD5_CTX context;
unsigned char buf[1000];
- long length = 0;
int nbytes;
ap_MD5Init(&context);
while ((nbytes = fread(buf, 1, sizeof(buf), infile))) {
- length += nbytes;
if (!convert) {
ascii2ebcdic(buf, buf, nbytes);
}
@@ -214,12 +212,10 @@
{
AP_MD5_CTX context;
unsigned char buf[1000];
- long length = 0;
unsigned int nbytes;
ap_MD5Init(&context);
while ((nbytes = fread(buf, 1, sizeof(buf), infile))) {
- length += nbytes;
ap_MD5Update(&context, buf, nbytes);
}
rewind(infile);
1.35 +3 -1 apache-1.3/src/modules/example/mod_example.c
Index: mod_example.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/example/mod_example.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- mod_example.c 1999/06/05 15:48:10 1.34
+++ mod_example.c 2000/03/01 09:13:38 1.35
@@ -424,9 +424,11 @@
* on the size (and readability) of the error_log is considerable.
*/
#define EXAMPLE_LOG_EACH 0
- if (EXAMPLE_LOG_EACH && (s != NULL)) {
+#if EXAMPLE_LOG_EACH
+ if (s != NULL) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, s, "mod_example: %s", note);
}
+#endif
}
/*--------------------------------------------------------------------------*/
1.69 +2 -2 apache-1.3/src/modules/proxy/mod_proxy.c
Index: mod_proxy.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/proxy/mod_proxy.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- mod_proxy.c 2000/01/11 14:13:43 1.68
+++ mod_proxy.c 2000/03/01 09:13:38 1.69
@@ -301,7 +301,7 @@
if (r->method_number == M_TRACE &&
(maxfwd_str = ap_table_get(r->headers_in, "Max-Forwards")) != NULL) {
- int maxfwd = strtol(maxfwd_str, NULL, 10);
+ long maxfwd = strtol(maxfwd_str, NULL, 10);
if (maxfwd < 1) {
int access_status;
r->proxyreq = NOT_PROXY;
@@ -312,7 +312,7 @@
return OK;
}
ap_table_setn(r->headers_in, "Max-Forwards",
- ap_psprintf(r->pool, "%d", (maxfwd > 0) ? maxfwd-1 : 0));
+ ap_psprintf(r->pool, "%ld", (maxfwd > 0) ? maxfwd-1 : 0));
}
if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)))
1.66 +6 -6 apache-1.3/src/modules/proxy/proxy_cache.c
Index: proxy_cache.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_cache.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- proxy_cache.c 1999/12/08 23:02:43 1.65
+++ proxy_cache.c 2000/03/01 09:13:38 1.66
@@ -195,8 +195,8 @@
/* Compare two gc_ent's, sort them by expiration date */
static int gcdiff(const void *ap, const void *bp)
{
- const struct gc_ent *a = (const struct gc_ent * const) ap;
- const struct gc_ent *b = (const struct gc_ent * const) bp;
+ const struct gc_ent *a = (const struct gc_ent *) ap;
+ const struct gc_ent *b = (const struct gc_ent *) bp;
if (a->expire > b->expire)
return 1;
@@ -385,7 +385,7 @@
for (i = 0; i < files->nelts; i++) {
fent = &((struct gc_ent *) files->elts)[i];
sprintf(filename, "%s%s", cachedir, fent->file);
- Explain3("GC Unlinking %s (expiry %ld, garbage_now %ld)", filename, fent->expire, garbage_now);
+ Explain3("GC Unlinking %s (expiry %ld, garbage_now %ld)", filename, (long)fent->expire, (long)garbage_now);
#if TESTING
fprintf(stderr, "Would unlink %s\n", filename);
#else
@@ -710,7 +710,7 @@
pragma = ap_table_get(r->headers_in, "Pragma");
auth = ap_table_get(r->headers_in, "Authorization");
Explain5("Request for %s, pragma=%s, auth=%s, ims=%ld, imstr=%s", url,
- pragma, auth, c->ims, imstr);
+ pragma, auth, (long)c->ims, imstr);
if (c->filename != NULL && r->method_number == M_GET &&
strlen(url) < 1024 && !ap_proxy_liststr(pragma, "no-cache") &&
auth == NULL) {
@@ -947,7 +947,7 @@
* else
* expire date = now + defaultexpire
*/
- Explain1("Expiry date is %ld", expc);
+ Explain1("Expiry date is %ld", (long)expc);
if (expc == BAD_DATE) {
if (lmod != BAD_DATE) {
double x = (double) (date - lmod) * conf->cache.lmfactor;
@@ -958,7 +958,7 @@
}
else
expc = now + conf->cache.defaultexpire;
- Explain1("Expiry date calculated %ld", expc);
+ Explain1("Expiry date calculated %ld", (long)expc);
}
/* get the content-length header */
1.87 +4 -4 apache-1.3/src/modules/proxy/proxy_util.c
Index: proxy_util.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_util.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- proxy_util.c 2000/02/29 14:24:28 1.86
+++ proxy_util.c 2000/03/01 09:13:38 1.87
@@ -239,12 +239,12 @@
strp = strchr(user, ':');
if (strp != NULL) {
*strp = '\0';
- password = ap_proxy_canonenc(p, strp + 1, strlen(strp + 1), enc_user, 1);
+ password = ap_proxy_canonenc(p, strp + 1, strlen(strp + 1), enc_user, STD_PROXY);
if (password == NULL)
return "Bad %-escape in URL (password)";
}
- user = ap_proxy_canonenc(p, user, strlen(user), enc_user, 1);
+ user = ap_proxy_canonenc(p, user, strlen(user), enc_user, STD_PROXY);
if (user == NULL)
return "Bad %-escape in URL (username)";
}
@@ -882,12 +882,12 @@
}
else {
ipaddr = ap_inet_addr(host);
- hp = gethostbyaddr((char *) &ipaddr, sizeof(u_long), AF_INET);
+ hp = gethostbyaddr((char *) &ipaddr, sizeof(ipaddr), AF_INET);
if (hp == NULL) {
memset(&hpbuf, 0, sizeof(hpbuf));
hpbuf.h_name = 0;
hpbuf.h_addrtype = AF_INET;
- hpbuf.h_length = sizeof(u_long);
+ hpbuf.h_length = sizeof(ipaddr);
hpbuf.h_addr_list = charpbuf;
hpbuf.h_addr_list[0] = (char *) &ipaddr;
hpbuf.h_addr_list[1] = 0;
1.102 +1 -1 apache-1.3/src/modules/standard/mod_negotiation.c
Index: mod_negotiation.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_negotiation.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- mod_negotiation.c 1999/07/29 17:54:06 1.101
+++ mod_negotiation.c 2000/03/01 09:13:39 1.102
@@ -2172,7 +2172,7 @@
* content-length, which currently leads to the correct result).
*/
if (!(variant->sub_req && variant->sub_req->handler)
- && (len = find_content_length(neg, variant)) != 0) {
+ && (len = (long)find_content_length(neg, variant)) != 0) {
lenstr = (char *) ap_palloc(r->pool, 22);
ap_snprintf(lenstr, 22, "%ld", len);
1.156 +1 -9 apache-1.3/src/modules/standard/mod_rewrite.c
Index: mod_rewrite.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -r1.155 -r1.156
--- mod_rewrite.c 2000/01/16 18:06:30 1.155
+++ mod_rewrite.c 2000/03/01 09:13:39 1.156
@@ -3275,10 +3275,6 @@
static void rewritelock_create(server_rec *s, pool *p)
{
- rewrite_server_conf *conf;
-
- conf = ap_get_module_config(s->module_config, &rewrite_module);
-
/* only operate if a lockfile is used */
if (lockname == NULL || *(lockname) == '\0') {
return;
@@ -3307,10 +3303,6 @@
static void rewritelock_open(server_rec *s, pool *p)
{
- rewrite_server_conf *conf;
-
- conf = ap_get_module_config(s->module_config, &rewrite_module);
-
/* only operate if a lockfile is used */
if (lockname == NULL || *(lockname) == '\0') {
return;
@@ -3864,7 +3856,7 @@
n = n * 53711 + 134561 + (unsigned)(*p & 0xff);
}
- return n % CACHE_TLB_ROWS;
+ return (int)(n % CACHE_TLB_ROWS);
}
static cacheentry *cache_tlb_lookup(cachetlbentry *tlb, cacheentry *elt,