dgaudet 97/07/20 22:54:05
Modified: src alloc.c alloc.h http_bprintf.c http_config.c http_config.h http_core.c http_log.c http_log.h http_main.c http_main.h httpd.h md5c.c mod_access.c mod_auth_db.c mod_autoindex.c mod_expires.c mod_info.c mod_negotiation.c mod_rewrite.c rfc1413.c scoreboard.h util.c src/modules/proxy mod_proxy.c mod_proxy.h proxy_cache.c Log: (mostly) pass "gcc -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wnested-externs". Notes: - Full prototypes are good, they catch errors at compile time. - Locals shadowing other locals or globals are bad, they cause errors inadvertantly (there once was a program with a global "int i;" ...). Even if the changes for this seem like gratuitous renaming, they're worth it in the long run. - Nested-externs are bad because they override the (correct) declarations of externs that (should be) provided by header files. - mod_rewrite isn't part of http_core and shouldn't be playing with the prelinked_modules variable. It now uses find_linked_module instead. - If an architecture doesn't use void (*)(int) as the prototypes for signal handlers we need to know, not cast it away. Note that void restart(int sig) has been around for a while so it's unlikely this will cause problems. - this is going to look huge as a context diff... I saved a unified if anyone wants to see it. Revision Changes Path 1.41 +5 -5 apache/src/alloc.c Index: alloc.c =================================================================== RCS file: /export/home/cvs/apache/src/alloc.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C3 -r1.40 -r1.41 *** alloc.c 1997/07/15 21:39:50 1.40 --- alloc.c 1997/07/21 05:53:40 1.41 *************** *** 75,81 **** */ char *cp; ! void (*f)(); long l; FILE *fp; double d; --- 75,81 ---- */ char *cp; ! void (*f)(void); long l; FILE *fp; double d; *************** *** 292,298 **** return new_pool; } ! void init_alloc() { alloc_mutex = create_mutex(NULL); spawn_mutex = create_mutex(NULL); --- 292,298 ---- return new_pool; } ! void init_alloc(void) { alloc_mutex = create_mutex(NULL); spawn_mutex = create_mutex(NULL); *************** *** 336,342 **** API_EXPORT(long) bytes_in_pool (pool *p) { return bytes_in_block_list (p->first); } ! API_EXPORT(long) bytes_in_free_blocks () { return bytes_in_block_list (block_freelist); } --- 336,342 ---- API_EXPORT(long) bytes_in_pool (pool *p) { return bytes_in_block_list (p->first); } ! API_EXPORT(long) bytes_in_free_blocks (void) { return bytes_in_block_list (block_freelist); } *************** *** 791,797 **** cleanup_pool_for_exec (p); } ! API_EXPORT(void) cleanup_for_exec() { #ifndef WIN32 /* --- 791,797 ---- cleanup_pool_for_exec (p); } ! API_EXPORT(void) cleanup_for_exec(void) { #ifndef WIN32 /* *************** *** 1047,1053 **** struct process_chain *next; }; ! void note_subprocess (pool *a, int pid, enum kill_conditions how) { struct process_chain *new = (struct process_chain *)palloc(a, sizeof(struct process_chain)); --- 1047,1053 ---- struct process_chain *next; }; ! API_EXPORT(void) note_subprocess (pool *a, int pid, enum kill_conditions how) { struct process_chain *new = (struct process_chain *)palloc(a, sizeof(struct process_chain)); 1.31 +6 -5 apache/src/alloc.h Index: alloc.h =================================================================== RCS file: /export/home/cvs/apache/src/alloc.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C3 -r1.30 -r1.31 *** alloc.h 1997/07/19 20:16:12 1.30 --- alloc.h 1997/07/21 05:53:41 1.31 *************** *** 80,86 **** typedef struct pool pool; extern pool *permanent_pool; ! void init_alloc(); /* Set up everything */ API_EXPORT(pool *) make_sub_pool (pool *); /* All pools are subpools of permanent_pool */ API_EXPORT(void) destroy_pool (pool *); --- 80,86 ---- typedef struct pool pool; extern pool *permanent_pool; ! void init_alloc(void); /* Set up everything */ API_EXPORT(pool *) make_sub_pool (pool *); /* All pools are subpools of permanent_pool */ API_EXPORT(void) destroy_pool (pool *); *************** *** 92,98 **** * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ ! API_EXPORT(void) cleanup_for_exec (); /* routines to allocate memory from an pool... */ --- 92,98 ---- * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ ! API_EXPORT(void) cleanup_for_exec (void); /* routines to allocate memory from an pool... */ *************** *** 203,210 **** * up with timeout handling in general... */ ! API_EXPORT(void) block_alarms(); ! API_EXPORT(void) unblock_alarms(); /* Common cases which want utility support.. * the note_cleanups_for_foo routines are for --- 203,210 ---- * up with timeout handling in general... */ ! API_EXPORT(void) block_alarms(void); ! API_EXPORT(void) unblock_alarms(void); /* Common cases which want utility support.. * the note_cleanups_for_foo routines are for *************** *** 249,254 **** --- 249,255 ---- enum kill_conditions { kill_never, kill_always, kill_after_timeout, just_wait, kill_only_once }; + API_EXPORT(void) note_subprocess (pool *a, int pid, enum kill_conditions how); API_EXPORT(int) spawn_child_err (pool *, int (*)(void *), void *, enum kill_conditions, FILE **pipe_in, FILE **pipe_out, FILE **pipe_err); *************** *** 263,266 **** /* Finally, some accounting */ API_EXPORT(long) bytes_in_pool(pool *p); ! API_EXPORT(long) bytes_in_free_blocks(); --- 264,267 ---- /* Finally, some accounting */ API_EXPORT(long) bytes_in_pool(pool *p); ! API_EXPORT(long) bytes_in_free_blocks(void); 1.12 +4 -4 apache/src/http_bprintf.c Index: http_bprintf.c =================================================================== RCS file: /export/home/cvs/apache/src/http_bprintf.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C3 -r1.11 -r1.12 *** http_bprintf.c 1997/07/15 21:39:51 1.11 --- http_bprintf.c 1997/07/21 05:53:41 1.12 *************** *** 65,71 **** const char *f,*fStop,*percentPtr,*p; char *fmtBuffPtr, *buffPtr; int op, performedOp, sizeModifier, buffLen, specifierLength; ! int fastPath, n, buffReqd, minWidth, precision, exp; int buffCount = 0; int auxBuffLen = 0; char *auxBuffPtr = NULL; --- 65,71 ---- const char *f,*fStop,*percentPtr,*p; char *fmtBuffPtr, *buffPtr; int op, performedOp, sizeModifier, buffLen, specifierLength; ! int fastPath, n, buffReqd, minWidth, precision, expon; int buffCount = 0; int auxBuffLen = 0; char *auxBuffPtr = NULL; *************** *** 298,309 **** { case ' ': doubleArg = va_arg(arg, double); ! frexp(doubleArg, &exp); break; case 'L': lDoubleArg = va_arg(arg, LONG_DOUBLE); ! frexp(lDoubleArg, &exp); break; default: --- 298,309 ---- { case ' ': doubleArg = va_arg(arg, double); ! frexp(doubleArg, &expon); break; case 'L': lDoubleArg = va_arg(arg, LONG_DOUBLE); ! frexp(lDoubleArg, &expon); break; default: *************** *** 311,317 **** } if(precision == -1) precision = 6; ! buffReqd = precision + 3 + ((exp > 0) ? exp/3 : 0); break; case 'e': --- 311,317 ---- } if(precision == -1) precision = 6; ! buffReqd = precision + 3 + ((expon > 0) ? expon/3 : 0); break; case 'e': 1.62 +12 -17 apache/src/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache/src/http_config.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C3 -r1.61 -r1.62 *** http_config.c 1997/07/17 22:27:28 1.61 --- http_config.c 1997/07/21 05:53:41 1.62 *************** *** 87,96 **** static int total_modules = 0; module *top_module = NULL; ! typedef int (*handler)(request_rec *); ! typedef void *(*maker)(pool *); ! typedef void *(*dir_maker)(pool *, char *); ! typedef void *(*merger)(pool *, void *, void *); /* Dealing with config vectors. These are associated with per-directory, * per-server, and per-request configuration, and have a void* pointer for --- 87,95 ---- static int total_modules = 0; module *top_module = NULL; ! typedef int (*handler_func)(request_rec *); ! typedef void *(*dir_maker_func)(pool *, char *); ! typedef void *(*merger_func)(pool *, void *, void *); /* Dealing with config vectors. These are associated with per-directory, * per-server, and per-request configuration, and have a void* pointer for *************** *** 129,135 **** module *modp; for (modp = top_module; modp; modp = modp->next) { ! dir_maker df = modp->create_dir_config; if (df) conf_vector[modp->module_index] = (*df)(p, NULL); } --- 128,134 ---- module *modp; for (modp = top_module; modp; modp = modp->next) { ! dir_maker_func df = modp->create_dir_config; if (df) conf_vector[modp->module_index] = (*df)(p, NULL); } *************** *** 146,152 **** module *modp; for (modp = top_module; modp; modp = modp->next) { ! merger df = modp->merge_dir_config; int i = modp->module_index; if (df && new_vector[i]) --- 145,151 ---- module *modp; for (modp = top_module; modp; modp = modp->next) { ! merger_func df = modp->merge_dir_config; int i = modp->module_index; if (df && new_vector[i]) *************** *** 183,189 **** module *modp; for (modp = top_module; modp; modp = modp->next) { ! merger df = modp->merge_server_config; int i = modp->module_index; if (!virt_vector[i]) --- 182,188 ---- module *modp; for (modp = top_module; modp; modp = modp->next) { ! merger_func df = modp->merge_server_config; int i = modp->module_index; if (!virt_vector[i]) *************** *** 281,287 **** * logger function. You go one-by-one from there until you hit a NULL. * This structure was designed to hopefully maximize cache-coolness. */ ! static handler *method_ptrs; /* routine to reconstruct all these shortcuts... called after every * add_module. --- 280,286 ---- * logger function. You go one-by-one from there until you hit a NULL. * This structure was designed to hopefully maximize cache-coolness. */ ! static handler_func *method_ptrs; /* routine to reconstruct all these shortcuts... called after every * add_module. *************** *** 294,300 **** int how_many_ptrs; int i; int next_ptr; ! handler fp; if (method_ptrs) { /* free up any previous set of method_ptrs */ --- 293,299 ---- int how_many_ptrs; int i; int next_ptr; ! handler_func fp; if (method_ptrs) { /* free up any previous set of method_ptrs */ *************** *** 305,316 **** how_many_ptrs = 0; for (modp = top_module; modp; modp = modp->next) { for (i = 0; i<NMETHODS; ++i) { ! if (*(handler *)(method_offsets[i] + (char *)modp)) { ++how_many_ptrs; } } } ! method_ptrs = malloc ((how_many_ptrs+NMETHODS)*sizeof (handler)); next_ptr = 0; for (i = 0; i<NMETHODS; ++i) { /* XXX: This is an itsy bit presumptuous about the alignment --- 304,315 ---- how_many_ptrs = 0; for (modp = top_module; modp; modp = modp->next) { for (i = 0; i<NMETHODS; ++i) { ! if (*(handler_func *)(method_offsets[i] + (char *)modp)) { ++how_many_ptrs; } } } ! method_ptrs = malloc ((how_many_ptrs+NMETHODS)*sizeof (handler_func)); next_ptr = 0; for (i = 0; i<NMETHODS; ++i) { /* XXX: This is an itsy bit presumptuous about the alignment *************** *** 318,324 **** * ANSI says this has to be true... -djg */ ((int *)&offsets_into_method_ptrs)[i] = next_ptr; for (modp = top_module; modp; modp = modp->next) { ! fp = *(handler *)(method_offsets[i] + (char *)modp); if (fp) { method_ptrs[next_ptr++] = fp; } --- 317,323 ---- * ANSI says this has to be true... -djg */ ((int *)&offsets_into_method_ptrs)[i] = next_ptr; for (modp = top_module; modp; modp = modp->next) { ! fp = *(handler_func *)(method_offsets[i] + (char *)modp); if (fp) { method_ptrs[next_ptr++] = fp; } *************** *** 334,340 **** int i; for (i = offset; method_ptrs[i]; ++i ) { ! handler mod_handler = method_ptrs[i]; if (mod_handler) { int result; --- 333,339 ---- int i; for (i = offset; method_ptrs[i]; ++i ) { ! handler_func mod_handler = method_ptrs[i]; if (mod_handler) { int result; *************** *** 475,481 **** void setup_prelinked_modules () { - extern module *prelinked_modules[], *preloaded_modules[]; module **m; /* First, set all module indices, and init total_modules. */ --- 474,479 ---- *************** *** 508,514 **** /* Add a named module. Returns 1 if module found, 0 otherwise. */ API_EXPORT(int) add_named_module (const char *name) { - extern module *preloaded_modules[]; module *modp; int i = 0; --- 506,511 ---- *************** *** 1300,1306 **** */ void show_directives() { - extern module *preloaded_modules[]; command_rec *pc; int n; --- 1297,1302 ---- *************** *** 1317,1323 **** /* Show the preloaded module names. Used for httpd -l. */ void show_modules() { - extern module *preloaded_modules[]; int n; printf ("Compiled-in modules:\n"); --- 1313,1318 ---- 1.40 +7 -4 apache/src/http_config.h Index: http_config.h =================================================================== RCS file: /export/home/cvs/apache/src/http_config.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C3 -r1.39 -r1.40 *** http_config.h 1997/07/20 13:17:59 1.39 --- http_config.h 1997/07/21 05:53:42 1.40 *************** *** 268,287 **** API_EXPORT(void) add_module (module *m); API_EXPORT(int) add_named_module (const char *name); ! API_EXPORT(void) clear_module_list (); API_EXPORT(const char *) find_module_name (module *m); API_EXPORT(module *) find_linked_module (const char *name); #ifdef CORE_PRIVATE /* For http_main.c... */ server_rec *read_config (pool *conf_pool, pool *temp_pool, char *config_name); void init_modules(pool *p, server_rec *s); void child_init_modules(pool *p, server_rec *s); ! void setup_prelinked_modules(); ! void show_directives(); ! void show_modules(); /* For http_request.c... */ --- 268,290 ---- API_EXPORT(void) add_module (module *m); API_EXPORT(int) add_named_module (const char *name); ! API_EXPORT(void) clear_module_list (void); API_EXPORT(const char *) find_module_name (module *m); API_EXPORT(module *) find_linked_module (const char *name); #ifdef CORE_PRIVATE + extern module *prelinked_modules[]; + extern module *preloaded_modules[]; + /* For http_main.c... */ server_rec *read_config (pool *conf_pool, pool *temp_pool, char *config_name); void init_modules(pool *p, server_rec *s); void child_init_modules(pool *p, server_rec *s); ! void setup_prelinked_modules(void); ! void show_directives(void); ! void show_modules(void); /* For http_request.c... */ 1.99 +4 -4 apache/src/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache/src/http_core.c,v retrieving revision 1.98 retrieving revision 1.99 diff -C3 -r1.98 -r1.99 *** http_core.c 1997/07/19 20:27:51 1.98 --- http_core.c 1997/07/21 05:53:42 1.99 *************** *** 577,583 **** return NULL; } ! const char *limit (cmd_parms *cmd, void *dummy, const char *arg) { const char *limited_methods = getword(cmd->pool,&arg,'>'); int limited = 0; --- 577,583 ---- return NULL; } ! const char *limit_section (cmd_parms *cmd, void *dummy, const char *arg) { const char *limited_methods = getword(cmd->pool,&arg,'>'); int limited = 0; *************** *** 599,605 **** return NULL; } ! const char *endlimit (cmd_parms *cmd, void *dummy, void *dummy2) { if (cmd->limited == -1) return "</Limit> unexpected"; --- 599,605 ---- return NULL; } ! const char *endlimit_section (cmd_parms *cmd, void *dummy, void *dummy2) { if (cmd->limited == -1) return "</Limit> unexpected"; *************** *** 1212,1219 **** { "</VirtualHost>", end_virtualhost_section, NULL, RSRC_CONF, NO_ARGS, "Marks end of <Directory>" }, { "<Files", filesection, NULL, OR_ALL, RAW_ARGS, "Container for directives affecting files matching specified patterns" }, { "</Files>", end_filesection, NULL, OR_ALL, NO_ARGS, "Marks end of <Files>" }, ! { "<Limit", limit, NULL, OR_ALL, RAW_ARGS, "Container for authentication directives when accessed using specified HTTP methods" }, ! { "</Limit>", endlimit, NULL, OR_ALL, RAW_ARGS, "Marks end of <Limit>" }, { "<IfModule", start_ifmod, NULL, OR_ALL, RAW_ARGS, "Container for directives based on existance of specified modules" }, { "</IfModule>", end_ifmod, NULL, OR_ALL, NO_ARGS, "Marks end of <IfModule>" }, { "<DirectoryMatch", dirsection, (void*)1, RSRC_CONF, RAW_ARGS, "Container for directives affecting resources located in the specified directories" }, --- 1212,1219 ---- { "</VirtualHost>", end_virtualhost_section, NULL, RSRC_CONF, NO_ARGS, "Marks end of <Directory>" }, { "<Files", filesection, NULL, OR_ALL, RAW_ARGS, "Container for directives affecting files matching specified patterns" }, { "</Files>", end_filesection, NULL, OR_ALL, NO_ARGS, "Marks end of <Files>" }, ! { "<Limit", limit_section, NULL, OR_ALL, RAW_ARGS, "Container for authentication directives when accessed using specified HTTP methods" }, ! { "</Limit>", endlimit_section, NULL, OR_ALL, RAW_ARGS, "Marks end of <Limit>" }, { "<IfModule", start_ifmod, NULL, OR_ALL, RAW_ARGS, "Container for directives based on existance of specified modules" }, { "</IfModule>", end_ifmod, NULL, OR_ALL, NO_ARGS, "Marks end of <IfModule>" }, { "<DirectoryMatch", dirsection, (void*)1, RSRC_CONF, RAW_ARGS, "Container for directives affecting resources located in the specified directories" }, 1.21 +1 -1 apache/src/http_log.c Index: http_log.c =================================================================== RCS file: /export/home/cvs/apache/src/http_log.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C3 -r1.20 -r1.21 *** http_log.c 1997/07/15 21:39:53 1.20 --- http_log.c 1997/07/21 05:53:43 1.21 *************** *** 158,164 **** fclose(pid_file); } ! API_EXPORT(void) log_error(char *err, server_rec *s) { fprintf(s->error_log, "[%s] %s\n",get_time(),err); fflush(s->error_log); } --- 158,164 ---- fclose(pid_file); } ! API_EXPORT(void) log_error(const char *err, server_rec *s) { fprintf(s->error_log, "[%s] %s\n",get_time(),err); fflush(s->error_log); } 1.10 +2 -2 apache/src/http_log.h Index: http_log.h =================================================================== RCS file: /export/home/cvs/apache/src/http_log.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C3 -r1.9 -r1.10 *** http_log.h 1997/07/15 21:39:54 1.9 --- http_log.h 1997/07/21 05:53:43 1.10 *************** *** 53,60 **** void open_logs (server_rec *, pool *p); API_EXPORT(void) error_log2stderr (server_rec *); ! void log_pid (pool *p, char *pid_fname); ! API_EXPORT(void) log_error(char *err, server_rec *s); API_EXPORT(void) log_unixerr(const char *routine, const char *file, const char *msg, server_rec *s); API_EXPORT(void) log_printf(const server_rec *s, const char *fmt, ...); --- 53,60 ---- void open_logs (server_rec *, pool *p); API_EXPORT(void) error_log2stderr (server_rec *); ! void log_pid (pool *p, char *fname); ! API_EXPORT(void) log_error(const char *err, server_rec *s); API_EXPORT(void) log_unixerr(const char *routine, const char *file, const char *msg, server_rec *s); API_EXPORT(void) log_printf(const server_rec *s, const char *fmt, ...); 1.184 +64 -62 apache/src/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache/src/http_main.c,v retrieving revision 1.183 retrieving revision 1.184 diff -C3 -r1.183 -r1.184 *** http_main.c 1997/07/21 03:37:49 1.183 --- http_main.c 1997/07/21 05:53:45 1.184 *************** *** 274,280 **** unlink(lock_fname); } ! void accept_mutex_on() { int ret; --- 274,280 ---- unlink(lock_fname); } ! void accept_mutex_on(void) { int ret; *************** *** 288,294 **** } } ! void accept_mutex_off() { if (fcntl (lock_fd, F_SETLKW, &unlock_it) < 0) { --- 288,294 ---- } } ! void accept_mutex_off(void) { if (fcntl (lock_fd, F_SETLKW, &unlock_it) < 0) { *************** *** 320,326 **** unlink(lock_fname); } ! void accept_mutex_on() { int ret; --- 320,326 ---- unlink(lock_fname); } ! void accept_mutex_on(void) { int ret; *************** *** 334,340 **** } } ! void accept_mutex_off() { if (flock (lock_fd, LOCK_UN) < 0) { --- 334,340 ---- } } ! void accept_mutex_off(void) { if (flock (lock_fd, LOCK_UN) < 0) { *************** *** 372,378 **** static APACHE_TLS conn_rec * current_conn; static APACHE_TLS request_rec *timeout_req; ! static APACHE_TLS char *timeout_name = NULL; static APACHE_TLS int alarms_blocked = 0; static APACHE_TLS int alarm_pending = 0; --- 372,378 ---- static APACHE_TLS conn_rec * current_conn; static APACHE_TLS request_rec *timeout_req; ! static APACHE_TLS const char *timeout_name = NULL; static APACHE_TLS int alarms_blocked = 0; static APACHE_TLS int alarm_pending = 0; *************** *** 511,517 **** int ! check_alarm() { #ifdef WIN32 if(alarm_expiry_time) --- 511,517 ---- int ! check_alarm(void) { #ifdef WIN32 if(alarm_expiry_time) *************** *** 658,664 **** current_conn->aborted = 1; } ! static void linger_timeout () { timeout_name = "lingering close"; --- 658,664 ---- current_conn->aborted = 1; } ! static void linger_timeout (void) { timeout_name = "lingering close"; *************** *** 1039,1045 **** #endif } ! void cleanup_scoreboard () { #ifdef SCOREBOARD_FILE unlink (scoreboard_fname); --- 1039,1045 ---- #endif } ! void cleanup_scoreboard (void) { #ifdef SCOREBOARD_FILE unlink (scoreboard_fname); *************** *** 1057,1063 **** * anyway. */ ! API_EXPORT(void) sync_scoreboard_image () { #ifdef SCOREBOARD_FILE lseek (scoreboard_fd, 0L, 0); --- 1057,1063 ---- * anyway. */ ! API_EXPORT(void) sync_scoreboard_image (void) { #ifdef SCOREBOARD_FILE lseek (scoreboard_fd, 0L, 0); *************** *** 1067,1073 **** #endif /* MULTITHREAD */ ! API_EXPORT(int) exists_scoreboard_image () { return (scoreboard_image ? 1 : 0); } --- 1067,1073 ---- #endif /* MULTITHREAD */ ! API_EXPORT(int) exists_scoreboard_image (void) { return (scoreboard_image ? 1 : 0); } *************** *** 1133,1139 **** return old_status; } ! static void update_scoreboard_global() { #ifdef SCOREBOARD_FILE lseek(scoreboard_fd, --- 1133,1139 ---- return old_status; } ! static void update_scoreboard_global(void) { #ifdef SCOREBOARD_FILE lseek(scoreboard_fd, *************** *** 1225,1231 **** return -1; } ! static void reclaim_child_processes () { #ifndef MULTITHREAD int i, status; --- 1225,1231 ---- return -1; } ! static void reclaim_child_processes (void) { #ifndef MULTITHREAD int i, status; *************** *** 1297,1303 **** in wait_or_timeout(). But this routine is still useful for systems with no waitpid(). */ ! int reap_children () { int status, n; int ret = 0; --- 1297,1303 ---- in wait_or_timeout(). But this routine is still useful for systems with no waitpid(). */ ! int reap_children (void) { int status, n; int ret = 0; *************** *** 1320,1326 **** * a while... */ ! static int wait_or_timeout () { #ifdef WIN32 #define MAXWAITOBJ MAXIMUM_WAIT_OBJECTS --- 1320,1326 ---- * a while... */ ! static int wait_or_timeout (void) { #ifdef WIN32 #define MAXWAITOBJ MAXIMUM_WAIT_OBJECTS *************** *** 1380,1386 **** } ! void sig_term() { log_error("httpd: caught SIGTERM, shutting down", server_conf); cleanup_scoreboard(); #ifdef SIGKILL --- 1380,1386 ---- } ! void sig_term(int sig) { log_error("httpd: caught SIGTERM, shutting down", server_conf); cleanup_scoreboard(); #ifdef SIGKILL *************** *** 1390,1396 **** exit(1); } ! void bus_error(void) { char emsg[256]; ap_snprintf --- 1390,1396 ---- exit(1); } ! void bus_error(int sig) { char emsg[256]; ap_snprintf *************** *** 1406,1412 **** exit(1); } ! void seg_fault() { char emsg[256]; ap_snprintf --- 1406,1412 ---- exit(1); } ! void seg_fault(int sig) { char emsg[256]; ap_snprintf *************** *** 1422,1435 **** exit(1); } ! void just_die() /* SIGHUP to child process??? */ { exit (0); } static int deferred_die; ! static void deferred_die_handler () { deferred_die = 1; } --- 1422,1435 ---- exit(1); } ! void just_die(int sig) /* SIGHUP to child process??? */ { exit (0); } static int deferred_die; ! static void deferred_die_handler (int sig) { deferred_die = 1; } *************** *** 1450,1456 **** } ! void set_signals() { #ifndef NO_USE_SIGACTION struct sigaction sa; --- 1450,1456 ---- } ! void set_signals(void) { #ifndef NO_USE_SIGACTION struct sigaction sa; *************** *** 1459,1497 **** sa.sa_flags = 0; if (!one_process) { ! sa.sa_handler = (void (*)())seg_fault; if (sigaction (SIGSEGV, &sa, NULL) < 0) log_unixerr ("sigaction(SIGSEGV)", NULL, NULL, server_conf); ! sa.sa_handler = (void (*)())bus_error; if (sigaction (SIGBUS, &sa, NULL) < 0) log_unixerr ("sigaction(SIGBUS)", NULL, NULL, server_conf); } ! sa.sa_handler = (void (*)())sig_term; if (sigaction (SIGTERM, &sa, NULL) < 0) log_unixerr ("sigaction(SIGTERM)", NULL, NULL, server_conf); /* we want to ignore HUPs and USR1 while we're busy processing one */ sigaddset (&sa.sa_mask, SIGHUP); sigaddset (&sa.sa_mask, SIGUSR1); ! sa.sa_handler = (void (*)())restart; if (sigaction (SIGHUP, &sa, NULL) < 0) log_unixerr ("sigaction(SIGHUP)", NULL, NULL, server_conf); if (sigaction (SIGUSR1, &sa, NULL) < 0) log_unixerr ("sigaction(SIGUSR1)", NULL, NULL, server_conf); #else if(!one_process) { ! signal (SIGSEGV, (void (*)(int))seg_fault); #ifdef SIGBUS ! signal (SIGBUS, (void (*)(int))bus_error); #endif /* SIGBUS */ } ! signal (SIGTERM, (void (*)(int))sig_term); #ifdef SIGHUP ! signal (SIGHUP, (void (*)(int))restart); #endif /* SIGHUP */ #ifdef SIGUSR1 ! signal (SIGUSR1, (void (*)(int))restart); #endif /* SIGUSR1 */ #endif } --- 1459,1497 ---- sa.sa_flags = 0; if (!one_process) { ! sa.sa_handler = seg_fault; if (sigaction (SIGSEGV, &sa, NULL) < 0) log_unixerr ("sigaction(SIGSEGV)", NULL, NULL, server_conf); ! sa.sa_handler = bus_error; if (sigaction (SIGBUS, &sa, NULL) < 0) log_unixerr ("sigaction(SIGBUS)", NULL, NULL, server_conf); } ! sa.sa_handler = sig_term; if (sigaction (SIGTERM, &sa, NULL) < 0) log_unixerr ("sigaction(SIGTERM)", NULL, NULL, server_conf); /* we want to ignore HUPs and USR1 while we're busy processing one */ sigaddset (&sa.sa_mask, SIGHUP); sigaddset (&sa.sa_mask, SIGUSR1); ! sa.sa_handler = restart; if (sigaction (SIGHUP, &sa, NULL) < 0) log_unixerr ("sigaction(SIGHUP)", NULL, NULL, server_conf); if (sigaction (SIGUSR1, &sa, NULL) < 0) log_unixerr ("sigaction(SIGUSR1)", NULL, NULL, server_conf); #else if(!one_process) { ! signal (SIGSEGV, seg_fault); #ifdef SIGBUS ! signal (SIGBUS, bus_error); #endif /* SIGBUS */ } ! signal (SIGTERM, sig_term); #ifdef SIGHUP ! signal (SIGHUP, restart); #endif /* SIGHUP */ #ifdef SIGUSR1 ! signal (SIGUSR1, restart); #endif /* SIGUSR1 */ #endif } *************** *** 1501,1507 **** * Here follows a long bunch of generic server bookkeeping stuff... */ ! void detach() { #ifndef WIN32 int x; --- 1501,1507 ---- * Here follows a long bunch of generic server bookkeeping stuff... */ ! void detach(void) { #ifndef WIN32 int x; *************** *** 1558,1564 **** * with different sets of groups for each. */ ! static void set_group_privs() { #ifndef WIN32 if(!geteuid()) { --- 1558,1564 ---- * with different sets of groups for each. */ ! static void set_group_privs(void) { #ifndef WIN32 if(!geteuid()) { *************** *** 1603,1609 **** } /* check to see if we have the 'suexec' setuid wrapper installed */ ! int init_suexec () { #ifndef WIN32 struct stat wrapper; --- 1603,1609 ---- } /* check to see if we have the 'suexec' setuid wrapper installed */ ! int init_suexec (void) { #ifndef WIN32 struct stat wrapper; *************** *** 1727,1733 **** no configured name, probably because they used DNS in the VirtualHost statement. It's disabled anyhow by the host matching code. -djg */ ! s->server_hostname = "bogus_host_without_forward_dns"; } } else if (has_default_vhost_addr) { s->server_hostname = def_hostname; --- 1727,1734 ---- no configured name, probably because they used DNS in the VirtualHost statement. It's disabled anyhow by the host matching code. -djg */ ! s->server_hostname = ! pstrdup (pconf, "bogus_host_without_forward_dns"); } } else if (has_default_vhost_addr) { s->server_hostname = def_hostname; *************** *** 1744,1750 **** "for %s (check DNS)\n", inet_ntoa(s->addrs->host_addr)); } ! s->server_hostname = "bogus_host_without_reverse_dns"; } } } --- 1745,1752 ---- "for %s (check DNS)\n", inet_ntoa(s->addrs->host_addr)); } ! s->server_hostname = ! pstrdup (pconf, "bogus_host_without_reverse_dns"); } } } *************** *** 1808,1814 **** /* MPE requires CAP=PM and GETPRIVMODE to bind to ports less than 1024 */ if (ntohs(server->sin_port) < 1024) GETPRIVMODE(); #endif ! if(bind(s, (struct sockaddr *)server,sizeof(struct sockaddr_in)) == -1) { perror("bind"); #ifdef MPE --- 1810,1816 ---- /* MPE requires CAP=PM and GETPRIVMODE to bind to ports less than 1024 */ if (ntohs(server->sin_port) < 1024) GETPRIVMODE(); #endif ! if(bind(s, (const struct sockaddr *)server,sizeof(struct sockaddr_in)) == -1) { perror("bind"); #ifdef MPE *************** *** 1827,1833 **** #endif } ! static int make_sock(pool *pconf, const struct sockaddr_in *server) { int s; int one = 1; --- 1829,1835 ---- #endif } ! static int make_sock(pool *p, const struct sockaddr_in *server) { int s; int one = 1; *************** *** 1844,1850 **** s = ap_slack(s, AP_SLACK_HIGH); ! note_cleanups_for_socket(pconf, s); /* arrange to close on exec or restart */ #ifndef MPE /* MPE does not support SO_REUSEADDR and SO_KEEPALIVE */ --- 1846,1852 ---- s = ap_slack(s, AP_SLACK_HIGH); ! note_cleanups_for_socket(p, s); /* arrange to close on exec or restart */ #ifndef MPE /* MPE does not support SO_REUSEADDR and SO_KEEPALIVE */ *************** *** 1952,1958 **** } ! static void close_unused_listeners() { listen_rec *or, *next; --- 1954,1960 ---- } ! static void close_unused_listeners(void) { listen_rec *or, *next; *************** *** 1967,1973 **** /* open sockets, and turn the listeners list into a singly linked ring */ ! static void setup_listeners(pool *pconf) { listen_rec *lr; int fd; --- 1969,1975 ---- /* open sockets, and turn the listeners list into a singly linked ring */ ! static void setup_listeners(pool *p) { listen_rec *lr; int fd; *************** *** 1978,1984 **** for(;;) { fd = find_listener (lr); if (fd < 0) { ! fd = make_sock (pconf, &lr->local_addr); } FD_SET (fd, &listenfds); if (fd > listenmaxfd) listenmaxfd = fd; --- 1980,1986 ---- for(;;) { fd = find_listener (lr); if (fd < 0) { ! fd = make_sock (p, &lr->local_addr); } FD_SET (fd, &listenfds); if (fd > listenmaxfd) listenmaxfd = fd; *************** *** 2016,2022 **** static int s_iInitCount = 0; int ! AMCSocketInitialize() { #ifdef WIN32 int iVersionRequested; --- 2018,2024 ---- static int s_iInitCount = 0; int ! AMCSocketInitialize(void) { #ifdef WIN32 int iVersionRequested; *************** *** 2057,2063 **** void ! AMCSocketCleanup() { #ifdef WIN32 if(--s_iInitCount == 0) --- 2059,2065 ---- void ! AMCSocketCleanup(void) { #ifdef WIN32 if(--s_iInitCount == 0) *************** *** 2135,2141 **** * we can exit cleanly. Since we're between connections right * now it's the right time to exit, but we might be blocked in a * system call when the graceful restart request is made. */ ! signal (SIGUSR1, (void (*)())just_die); /* * (Re)initialize this child to a pre-connection state. --- 2137,2143 ---- * we can exit cleanly. Since we're between connections right * now it's the right time to exit, but we might be blocked in a * system call when the graceful restart request is made. */ ! signal (SIGUSR1, just_die); /* * (Re)initialize this child to a pre-connection state. *************** *** 2190,2196 **** * defer the exit */ deferred_die = 0; ! signal (SIGUSR1, (void (*)())deferred_die_handler); for (;;) { clen = sizeof(sa_client); csd = accept(sd, &sa_client, &clen); --- 2192,2198 ---- * defer the exit */ deferred_die = 0; ! signal (SIGUSR1, deferred_die_handler); for (;;) { clen = sizeof(sa_client); csd = accept(sd, &sa_client, &clen); *************** *** 2216,2222 **** } /* go around again, safe to die */ ! signal (SIGUSR1, (void (*)())just_die); if (deferred_die) { /* ok maybe not, see ya later */ exit (0); --- 2218,2224 ---- } /* go around again, safe to die */ ! signal (SIGUSR1, just_die); if (deferred_die) { /* ok maybe not, see ya later */ exit (0); *************** *** 2321,2327 **** * connections to close before receiving a response because * of network latencies and server timeouts. */ ! signal (SIGUSR1, (void (*)())just_die); } /* --- 2323,2329 ---- * connections to close before receiving a response because * of network latencies and server timeouts. */ ! signal (SIGUSR1, just_die); } /* *************** *** 2348,2380 **** } } ! static int make_child(server_rec *server_conf, int child_num) { int pid; ! if (child_num + 1 > max_daemons_limit) { ! max_daemons_limit = child_num + 1; } if (one_process) { ! signal (SIGHUP, (void (*)())just_die); ! signal (SIGTERM, (void (*)())just_die); ! child_main (child_num); } /* avoid starvation */ head_listener = head_listener->next; ! Explain1 ("Starting new child in slot %d", child_num); ! (void)update_child_status (child_num, SERVER_STARTING, (request_rec *)NULL); if ((pid = fork()) == -1) { ! log_unixerr("fork", NULL, "Unable to fork new process", server_conf); /* fork didn't succeed. Fix the scoreboard or else * it will say SERVER_STARTING forever and ever */ ! (void)update_child_status (child_num, SERVER_DEAD, (request_rec*)NULL); /* In case system resources are maxxed out, we don't want Apache running away with the CPU trying to fork over and --- 2350,2382 ---- } } ! static int make_child(server_rec *s, int slot) { int pid; ! if (slot + 1 > max_daemons_limit) { ! max_daemons_limit = slot + 1; } if (one_process) { ! signal (SIGHUP, just_die); ! signal (SIGTERM, just_die); ! child_main (slot); } /* avoid starvation */ head_listener = head_listener->next; ! Explain1 ("Starting new child in slot %d", slot); ! (void)update_child_status (slot, SERVER_STARTING, (request_rec *)NULL); if ((pid = fork()) == -1) { ! log_unixerr("fork", NULL, "Unable to fork new process", s); /* fork didn't succeed. Fix the scoreboard or else * it will say SERVER_STARTING forever and ever */ ! (void)update_child_status (slot, SERVER_DEAD, (request_rec*)NULL); /* In case system resources are maxxed out, we don't want Apache running away with the CPU trying to fork over and *************** *** 2389,2398 **** * Note that since restart() just notes that a restart has been * requested there's no race condition here. */ ! signal (SIGHUP, (void (*)())just_die); ! signal (SIGUSR1, (void (*)())just_die); ! signal (SIGTERM, (void (*)())just_die); ! child_main (child_num); } /* If the parent proceeds with a restart before the child has written --- 2391,2400 ---- * Note that since restart() just notes that a restart has been * requested there's no race condition here. */ ! signal (SIGHUP, just_die); ! signal (SIGUSR1, just_die); ! signal (SIGTERM, just_die); ! child_main (slot); } /* If the parent proceeds with a restart before the child has written *************** *** 2402,2408 **** * to the same word.) * XXX: this needs to be sync'd to disk in the non shared memory stuff */ ! scoreboard_image->servers[child_num].pid = pid; return 0; } --- 2404,2410 ---- * to the same word.) * XXX: this needs to be sync'd to disk in the non shared memory stuff */ ! scoreboard_image->servers[slot].pid = pid; return 0; } *************** *** 2425,2431 **** } ! static void perform_idle_server_maintenance () { int i; int to_kill; --- 2427,2433 ---- } ! static void perform_idle_server_maintenance (void) { int i; int to_kill; 1.16 +2 -2 apache/src/http_main.h Index: http_main.h =================================================================== RCS file: /export/home/cvs/apache/src/http_main.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C3 -r1.15 -r1.16 *** http_main.h 1997/07/15 21:39:55 1.15 --- http_main.h 1997/07/21 05:53:46 1.16 *************** *** 91,98 **** API_EXPORT(void) kill_timeout (request_rec *); API_EXPORT(void) reset_timeout (request_rec *); ! API_EXPORT(void) sync_scoreboard_image (); int update_child_status (int child_num, int status, request_rec *r); void time_process_request (int child_num, int status); unsigned int set_callback_and_alarm(void (*fn)(int), int x); ! int check_alarm(); --- 91,98 ---- API_EXPORT(void) kill_timeout (request_rec *); API_EXPORT(void) reset_timeout (request_rec *); ! API_EXPORT(void) sync_scoreboard_image (void); int update_child_status (int child_num, int status, request_rec *r); void time_process_request (int child_num, int status); unsigned int set_callback_and_alarm(void (*fn)(int), int x); ! int check_alarm(void); 1.130 +1 -1 apache/src/httpd.h Index: httpd.h =================================================================== RCS file: /export/home/cvs/apache/src/httpd.h,v retrieving revision 1.129 retrieving revision 1.130 diff -C3 -r1.129 -r1.130 *** httpd.h 1997/07/19 19:42:18 1.129 --- httpd.h 1997/07/21 05:53:46 1.130 *************** *** 686,692 **** extern MODULE_VAR_EXPORT const char month_snames[12][4]; API_EXPORT(struct tm *) get_gmtoff(int *tz); ! API_EXPORT(char *) get_time(); API_EXPORT(char *) ht_time (pool *p, time_t t, const char *fmt, int gmt); API_EXPORT(char *) gm_timestr_822(pool *p, time_t t); --- 686,692 ---- extern MODULE_VAR_EXPORT const char month_snames[12][4]; API_EXPORT(struct tm *) get_gmtoff(int *tz); ! API_EXPORT(char *) get_time(void); API_EXPORT(char *) ht_time (pool *p, time_t t, const char *fmt, int gmt); API_EXPORT(char *) gm_timestr_822(pool *p, time_t t); 1.6 +9 -9 apache/src/md5c.c Index: md5c.c =================================================================== RCS file: /export/home/cvs/apache/src/md5c.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C3 -r1.5 -r1.6 *** md5c.c 1997/07/19 20:16:13 1.5 --- md5c.c 1997/07/21 05:53:47 1.6 *************** *** 174,207 **** */ API_EXPORT(void) MD5Update(MD5_CTX *context, const unsigned char *input, unsigned int inputLen) { ! unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ ! index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += (UINT4)inputLen >> 29; ! partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { ! memcpy(&context->buffer[index], input, partLen); MD5Transform(context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform(context->state, &input[i]); ! index = 0; } else i = 0; /* Buffer remaining input */ ! memcpy(&context->buffer[index], &input[i], inputLen-i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the --- 174,207 ---- */ API_EXPORT(void) MD5Update(MD5_CTX *context, const unsigned char *input, unsigned int inputLen) { ! unsigned int i, idx, partLen; /* Compute number of bytes mod 64 */ ! idx = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += (UINT4)inputLen >> 29; ! partLen = 64 - idx; /* Transform as many times as possible. */ if (inputLen >= partLen) { ! memcpy(&context->buffer[idx], input, partLen); MD5Transform(context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform(context->state, &input[i]); ! idx = 0; } else i = 0; /* Buffer remaining input */ ! memcpy(&context->buffer[idx], &input[i], inputLen-i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the *************** *** 210,223 **** API_EXPORT(void) MD5Final(unsigned char digest[16], MD5_CTX *context) { unsigned char bits[8]; ! unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ ! index = (unsigned int)((context->count[0] >> 3) & 0x3f); ! padLen = (index < 56) ? (56 - index) : (120 - index); MD5Update(context, PADDING, padLen); /* Append length (before padding) */ --- 210,223 ---- API_EXPORT(void) MD5Final(unsigned char digest[16], MD5_CTX *context) { unsigned char bits[8]; ! unsigned int idx, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ ! idx = (unsigned int)((context->count[0] >> 3) & 0x3f); ! padLen = (idx < 56) ? (56 - idx) : (120 - idx); MD5Update(context, PADDING, padLen); /* Append length (before padding) */ 1.19 +5 -5 apache/src/mod_access.c Index: mod_access.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_access.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C3 -r1.18 -r1.19 *** mod_access.c 1997/07/17 22:27:30 1.18 --- mod_access.c 1997/07/21 05:53:48 1.19 *************** *** 97,112 **** const char *order (cmd_parms *cmd, void *dv, char *arg) { access_dir_conf *d = (access_dir_conf *)dv; ! int i, order; ! if (!strcasecmp (arg, "allow,deny")) order = ALLOW_THEN_DENY; ! else if (!strcasecmp (arg, "deny,allow")) order = DENY_THEN_ALLOW; ! else if (!strcasecmp (arg, "mutual-failure")) order = MUTUAL_FAILURE; else return "unknown order"; for (i = 0; i < METHODS; ++i) if (cmd->limited & (1 << i)) ! d->order[i] = order; return NULL; } --- 97,112 ---- const char *order (cmd_parms *cmd, void *dv, char *arg) { access_dir_conf *d = (access_dir_conf *)dv; ! int i, o; ! if (!strcasecmp (arg, "allow,deny")) o = ALLOW_THEN_DENY; ! else if (!strcasecmp (arg, "deny,allow")) o = DENY_THEN_ALLOW; ! else if (!strcasecmp (arg, "mutual-failure")) o = MUTUAL_FAILURE; else return "unknown order"; for (i = 0; i < METHODS; ++i) if (cmd->limited & (1 << i)) ! d->order[i] = o; return NULL; } 1.16 +1 -1 apache/src/mod_auth_db.c Index: mod_auth_db.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_auth_db.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C3 -r1.15 -r1.16 *** mod_auth_db.c 1997/07/19 08:02:05 1.15 --- mod_auth_db.c 1997/07/21 05:53:48 1.16 *************** *** 143,149 **** q.size = strlen(q.data); if(!(f=dbopen(auth_dbpwfile,O_RDONLY,0664,DB_HASH,NULL))) { ! log_reason ("could not open db auth file", (char *) auth_dbpwfile, r); return NULL; } --- 143,149 ---- q.size = strlen(q.data); if(!(f=dbopen(auth_dbpwfile,O_RDONLY,0664,DB_HASH,NULL))) { ! log_reason ("could not open db auth file", auth_dbpwfile, r); return NULL; } 1.40 +4 -4 apache/src/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_autoindex.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C3 -r1.39 -r1.40 *** mod_autoindex.c 1997/07/17 22:27:33 1.39 --- mod_autoindex.c 1997/07/21 05:53:49 1.40 *************** *** 714,720 **** clear_pool (scratch); if ((!strcmp(ar[x]->name, "../")) || (!strcmp(ar[x]->name, ".."))) { ! char *t = make_full_path (scratch, name, "../"); getparents(t); if (t[0] == '\0') t = "/"; anchor = pstrcat (scratch, "<A HREF=\"", --- 714,720 ---- clear_pool (scratch); if ((!strcmp(ar[x]->name, "../")) || (!strcmp(ar[x]->name, ".."))) { ! t = make_full_path (scratch, name, "../"); getparents(t); if (t[0] == '\0') t = "/"; anchor = pstrcat (scratch, "<A HREF=\"", *************** *** 770,779 **** rvputs(r, " ", anchor, t2, NULL); if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { if (ar[x]->lm != -1) { ! char time[MAX_STRING_LEN]; struct tm *ts = localtime(&ar[x]->lm); ! strftime(time, MAX_STRING_LEN, "%d-%b-%y %H:%M ", ts); ! rputs(time, r); } else { rputs(" ", r); --- 770,779 ---- rvputs(r, " ", anchor, t2, NULL); if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { if (ar[x]->lm != -1) { ! char time_str[MAX_STRING_LEN]; struct tm *ts = localtime(&ar[x]->lm); ! strftime(time_str, MAX_STRING_LEN, "%d-%b-%y %H:%M ", ts); ! rputs(time_str, r); } else { rputs(" ", r); 1.12 +12 -12 apache/src/mod_expires.c Index: mod_expires.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_expires.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C3 -r1.11 -r1.12 *** mod_expires.c 1997/07/17 22:27:36 1.11 --- mod_expires.c 1997/07/21 05:53:49 1.12 *************** *** 234,240 **** * string. If we return NULL then real_code contains code converted * to the cnnnn format. */ ! char *check_code( pool *pool, const char *code, char **real_code ) { char *word; char base = 'X'; --- 234,240 ---- * string. If we return NULL then real_code contains code converted * to the cnnnn format. */ ! char *check_code( pool *p, const char *code, char **real_code ) { char *word; char base = 'X'; *************** *** 246,252 **** /* 0.0.4 compatibility? */ if ( (code[0] == 'A') || (code[0] == 'M') ) { ! *real_code = pstrdup( pool, code ); return NULL; }; --- 246,252 ---- /* 0.0.4 compatibility? */ if ( (code[0] == 'A') || (code[0] == 'M') ) { ! *real_code = pstrdup( p, code ); return NULL; }; *************** *** 255,276 **** /* <base> */ ! word = getword_conf( pool, &code ); if ( !strncasecmp( word, "now", 1 ) || !strncasecmp( word, "access", 1 ) ) { base = 'A'; } else if ( !strncasecmp( word, "modification", 1 ) ) { base = 'M'; } else { ! return pstrcat( pool, "bad expires code, unrecognised <base> '", word, "'", NULL); }; /* [plus] */ ! word = getword_conf( pool, &code ); if ( !strncasecmp( word, "plus", 1 ) ) { ! word = getword_conf( pool, &code ); }; /* {<num> <type>}* --- 255,276 ---- /* <base> */ ! word = getword_conf( p, &code ); if ( !strncasecmp( word, "now", 1 ) || !strncasecmp( word, "access", 1 ) ) { base = 'A'; } else if ( !strncasecmp( word, "modification", 1 ) ) { base = 'M'; } else { ! return pstrcat( p, "bad expires code, unrecognised <base> '", word, "'", NULL); }; /* [plus] */ ! word = getword_conf( p, &code ); if ( !strncasecmp( word, "plus", 1 ) ) { ! word = getword_conf( p, &code ); }; /* {<num> <type>}* *************** *** 281,297 **** if (isdigit(word[0])) { num = atoi( word ); } else { ! return pstrcat( pool, "bad expires code, numeric value expected <num> '", word, "'", NULL); }; /* <type> */ ! word = getword_conf( pool, &code ); if ( word[0] ) { /* do nothing */ } else { ! return pstrcat( pool, "bad expires code, missing <type>", NULL); }; factor = 0; --- 281,297 ---- if (isdigit(word[0])) { num = atoi( word ); } else { ! return pstrcat( p, "bad expires code, numeric value expected <num> '", word, "'", NULL); }; /* <type> */ ! word = getword_conf( p, &code ); if ( word[0] ) { /* do nothing */ } else { ! return pstrcat( p, "bad expires code, missing <type>", NULL); }; factor = 0; *************** *** 310,316 **** } else if ( !strncasecmp( word, "seconds", 1 ) ) { factor = 1; } else { ! return pstrcat( pool, "bad expires code, unrecognised <type>", "'", word, "'", NULL); }; --- 310,316 ---- } else if ( !strncasecmp( word, "seconds", 1 ) ) { factor = 1; } else { ! return pstrcat( p, "bad expires code, unrecognised <type>", "'", word, "'", NULL); }; *************** *** 318,328 **** /* next <num> */ ! word = getword_conf( pool, &code ); }; ap_snprintf(foo, sizeof(foo), "%c%d", base, modifier ); ! *real_code = pstrdup( pool, foo ); return NULL; } --- 318,328 ---- /* next <num> */ ! word = getword_conf( p, &code ); }; ap_snprintf(foo, sizeof(foo), "%c%d", base, modifier ); ! *real_code = pstrdup( p, foo ); return NULL; } 1.22 +0 -13 apache/src/mod_info.c Index: mod_info.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_info.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C3 -r1.21 -r1.22 *** mod_info.c 1997/07/19 09:02:47 1.21 --- mod_info.c 1997/07/21 05:53:49 1.22 *************** *** 320,338 **** mod_info_config_lines *mod_info_cfg_httpd=NULL; mod_info_config_lines *mod_info_cfg_srm=NULL; mod_info_config_lines *mod_info_cfg_access=NULL; - extern int standalone; - extern uid_t user_id; - extern char *user_name; - extern gid_t group_id; - extern int max_requests_per_child; - extern char *pid_fname; - extern char *scoreboard_fname; - extern int daemons_to_start; - extern int daemons_min_free; - extern int daemons_max_free; - extern int daemons_limit; - extern char server_root[MAX_STRING_LEN]; - extern char server_confname[MAX_STRING_LEN]; r->content_type = "text/html"; send_http_header(r); --- 320,325 ---- 1.51 +8 -8 apache/src/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v retrieving revision 1.50 retrieving revision 1.51 diff -C3 -r1.50 -r1.51 *** mod_negotiation.c 1997/07/19 08:16:14 1.50 --- mod_negotiation.c 1997/07/21 05:53:50 1.51 *************** *** 835,843 **** * be 1 for star/star, 2 for type/star and 3 for type/subtype. */ ! int mime_match (accept_rec *accept, var_rec *avail) { ! char *accept_type = accept->type_name; char *avail_type = avail->type_name; int len = strlen(accept_type); --- 835,843 ---- * be 1 for star/star, 2 for type/star and 3 for type/subtype. */ ! int mime_match (accept_rec *accept_r, var_rec *avail) { ! char *accept_type = accept_r->type_name; char *avail_type = avail->type_name; int len = strlen(accept_type); *************** *** 856,862 **** || (!strcmp (accept_type, "text/html") && (!strcmp(avail_type, INCLUDES_MAGIC_TYPE) || !strcmp(avail_type, INCLUDES_MAGIC_TYPE3)))) { ! if (accept->level >= avail->level) { avail->level_matched = avail->level; avail->mime_stars = 3; return 1; --- 856,862 ---- || (!strcmp (accept_type, "text/html") && (!strcmp(avail_type, INCLUDES_MAGIC_TYPE) || !strcmp(avail_type, INCLUDES_MAGIC_TYPE3)))) { ! if (accept_r->level >= avail->level) { avail->level_matched = avail->level; avail->mime_stars = 3; return 1; *************** *** 1046,1052 **** { int i; int naccept = neg->accept_langs->nelts; ! int index; neg_dir_config *conf = NULL; char *firstlang; --- 1046,1052 ---- { int i; int naccept = neg->accept_langs->nelts; ! int idx; neg_dir_config *conf = NULL; char *firstlang; *************** *** 1165,1180 **** * stuff anyway, don't both with handling multiple languages * per variant, just use the first one assigned to it */ ! index = 0; if (variant->content_languages && variant->content_languages->nelts) firstlang = ((char**)variant->content_languages->elts)[0]; else firstlang = ""; if (naccept == 0) /* Client doesn't care */ ! index = find_default_index (conf, firstlang); else /* Client has Accept-Language */ ! index = find_lang_index (neg->accept_langs, firstlang); ! variant->lang_index = index; return; } --- 1165,1180 ---- * stuff anyway, don't both with handling multiple languages * per variant, just use the first one assigned to it */ ! idx = 0; if (variant->content_languages && variant->content_languages->nelts) firstlang = ((char**)variant->content_languages->elts)[0]; else firstlang = ""; if (naccept == 0) /* Client doesn't care */ ! idx = find_default_index (conf, firstlang); else /* Client has Accept-Language */ ! idx = find_lang_index (neg->accept_langs, firstlang); ! variant->lang_index = idx; return; } 1.35 +13 -24 apache/src/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C3 -r1.34 -r1.35 *** mod_rewrite.c 1997/07/18 09:48:06 1.34 --- mod_rewrite.c 1997/07/21 05:53:50 1.35 *************** *** 2343,2349 **** static void rewritelog(request_rec *r, int level, const char *text, ...) { rewrite_server_conf *conf; ! conn_rec *connect; char *str1; char str2[512]; char str3[1024]; --- 2343,2349 ---- static void rewritelog(request_rec *r, int level, const char *text, ...) { rewrite_server_conf *conf; ! conn_rec *conn; char *str1; char str2[512]; char str3[1024]; *************** *** 2357,2363 **** va_start(ap, text); conf = get_module_config(r->server->module_config, &rewrite_module); ! connect = r->connection; if (conf->rewritelogfp <0) return; --- 2357,2363 ---- va_start(ap, text); conf = get_module_config(r->server->module_config, &rewrite_module); ! conn = r->connection; if (conf->rewritelogfp <0) return; *************** *** 2369,2390 **** if (level > conf->rewriteloglevel) return; ! if (connect->user == NULL) { ruser = "-"; } ! else if (strlen (connect->user) != 0) { ! ruser = connect->user; } else { ruser = "\"\""; } ! rhost = get_remote_host(connect, r->server->module_config, REMOTE_NAME); if (rhost == NULL) rhost = "UNKNOWN-HOST"; str1 = pstrcat(r->pool, rhost, " ", ! (connect->remote_logname != NULL ? connect->remote_logname : "-"), " ", ruser, NULL); ap_vsnprintf(str2, sizeof(str2), text, ap); --- 2369,2390 ---- if (level > conf->rewriteloglevel) return; ! if (conn->user == NULL) { ruser = "-"; } ! else if (strlen (conn->user) != 0) { ! ruser = conn->user; } else { ruser = "\"\""; } ! rhost = get_remote_host(conn, r->server->module_config, REMOTE_NAME); if (rhost == NULL) rhost = "UNKNOWN-HOST"; str1 = pstrcat(r->pool, rhost, " ", ! (conn->remote_logname != NULL ? conn->remote_logname : "-"), " ", ruser, NULL); ap_vsnprintf(str2, sizeof(str2), text, ap); *************** *** 2822,2839 **** return c; } ! static void set_cache_string(cache *c, char *res, int mode, time_t time, char *key, char *value) { cacheentry ce; ! ce.time = time; ce.key = key; ce.value = value; store_cache_string(c, res, &ce); return; } ! static char *get_cache_string(cache *c, char *res, int mode, time_t time, char *key) { cacheentry *ce; --- 2822,2839 ---- return c; } ! static void set_cache_string(cache *c, char *res, int mode, time_t t, char *key, char *value) { cacheentry ce; ! ce.time = t; ce.key = key; ce.value = value; store_cache_string(c, res, &ce); return; } ! static char *get_cache_string(cache *c, char *res, int mode, time_t t, char *key) { cacheentry *ce; *************** *** 2841,2851 **** if (ce == NULL) return NULL; if (mode & CACHEMODE_TS) { ! if (time != ce->time) return NULL; } else if (mode & CACHEMODE_TTL) { ! if (time > ce->time) return NULL; } return pstrdup(c->pool, ce->value); --- 2841,2851 ---- if (ce == NULL) return NULL; if (mode & CACHEMODE_TS) { ! if (t != ce->time) return NULL; } else if (mode & CACHEMODE_TTL) { ! if (t > ce->time) return NULL; } return pstrdup(c->pool, ce->value); *************** *** 3235,3252 **** static int is_proxy_available(server_rec *s) { ! extern module *preloaded_modules[]; ! command_rec *c; ! int n; ! ! for (n = 0; preloaded_modules[n] != NULL; n++) { ! for (c = preloaded_modules[n]->cmds; c && c->name; ++c) { ! if (strcmp(c->name, "ProxyRequests") == 0) { ! return 1; ! } ! } ! } ! return 0; } --- 3235,3241 ---- static int is_proxy_available(server_rec *s) { ! return find_linked_module ("mod_proxy") != NULL; } 1.13 +0 -5 apache/src/rfc1413.c Index: rfc1413.c =================================================================== RCS file: /export/home/cvs/apache/src/rfc1413.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C3 -r1.12 -r1.13 *** rfc1413.c 1997/06/15 19:22:33 1.12 --- rfc1413.c 1997/07/21 05:53:51 1.13 *************** *** 77,87 **** #include "rfc1413.h" #include "http_main.h" /* set_callback_and_alarm */ - #if !defined(SCO) && !defined(WIN32) - extern char *strchr(); - extern char *inet_ntoa(); - #endif - /* Local stuff. */ /* Semi-well-known port */ #define RFC1413_PORT 113 --- 77,82 ---- 1.26 +1 -1 apache/src/scoreboard.h Index: scoreboard.h =================================================================== RCS file: /export/home/cvs/apache/src/scoreboard.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C3 -r1.25 -r1.26 *** scoreboard.h 1997/07/15 21:39:58 1.25 --- scoreboard.h 1997/07/21 05:53:51 1.26 *************** *** 116,122 **** API_EXPORT(void) sync_scoreboard_image(void); API_EXPORT(short_score) get_scoreboard_info(int x); ! API_EXPORT(int) exists_scoreboard_image (); /* for time_process_request() in http_main.c */ #define START_PREQUEST 1 --- 116,122 ---- API_EXPORT(void) sync_scoreboard_image(void); API_EXPORT(short_score) get_scoreboard_info(int x); ! API_EXPORT(int) exists_scoreboard_image (void); /* for time_process_request() in http_main.c */ #define START_PREQUEST 1 1.64 +5 -5 apache/src/util.c Index: util.c =================================================================== RCS file: /export/home/cvs/apache/src/util.c,v retrieving revision 1.63 retrieving revision 1.64 diff -C3 -r1.63 -r1.64 *** util.c 1997/07/15 22:36:52 1.63 --- util.c 1997/07/21 05:53:52 1.64 *************** *** 842,848 **** /* Long enough, even if port > 16 bits for some reason */ if (port == DEFAULT_PORT) ! return (char *)hostname; else { ap_snprintf (portnum, sizeof(portnum), "%u", port); return pstrcat (p, hostname, ":", portnum, NULL); --- 842,848 ---- /* Long enough, even if port > 16 bits for some reason */ if (port == DEFAULT_PORT) ! return pstrdup (p, hostname); else { ap_snprintf (portnum, sizeof(portnum), "%u", port); return pstrcat (p, hostname, ":", portnum, NULL); *************** *** 1310,1316 **** API_EXPORT(char *) uudecode(pool *p, const char *bufcoded) { int nbytesdecoded; ! register unsigned char *bufin; register char *bufplain; register unsigned char *bufout; register int nprbytes; --- 1310,1316 ---- API_EXPORT(char *) uudecode(pool *p, const char *bufcoded) { int nbytesdecoded; ! register const unsigned char *bufin; register char *bufplain; register unsigned char *bufout; register int nprbytes; *************** *** 1322,1336 **** /* Figure out how many characters are in the input buffer. * Allocate this many from the per-transaction pool for the result. */ ! bufin = (unsigned char *)bufcoded; while(pr2six[*(bufin++)] <= 63); ! nprbytes = (char *)bufin - bufcoded - 1; nbytesdecoded = ((nprbytes+3)/4) * 3; bufplain = palloc(p, nbytesdecoded + 1); bufout = (unsigned char *)bufplain; ! bufin = (unsigned char *)bufcoded; while (nprbytes > 0) { *(bufout++) = --- 1322,1336 ---- /* Figure out how many characters are in the input buffer. * Allocate this many from the per-transaction pool for the result. */ ! bufin = (const unsigned char *)bufcoded; while(pr2six[*(bufin++)] <= 63); ! nprbytes = (bufin - (const unsigned char *)bufcoded) - 1; nbytesdecoded = ((nprbytes+3)/4) * 3; bufplain = palloc(p, nbytesdecoded + 1); bufout = (unsigned char *)bufplain; ! bufin = (const unsigned char *)bufcoded; while (nprbytes > 0) { *(bufout++) = 1.18 +4 -4 apache/src/modules/proxy/mod_proxy.c Index: mod_proxy.c =================================================================== RCS file: /export/home/cvs/apache/src/modules/proxy/mod_proxy.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C3 -r1.17 -r1.18 *** mod_proxy.c 1997/07/19 20:16:20 1.17 --- mod_proxy.c 1997/07/21 05:54:03 1.18 *************** *** 299,315 **** /* we only know how to handle communication to a proxy via http */ /*if (strcmp(scheme, "http") == 0)*/ { ! int i; struct dirconn_entry *list=(struct dirconn_entry*)conf->dirconn->elts; /* if (*++p == '/' && *++p == '/') */ ! for (direct_connect=i=0; i < conf->dirconn->nelts && !direct_connect; i++) { ! direct_connect = list[i].matcher (&list[i], r); /*log_error("URI and NoProxy:", r->server);*/ /*log_error(r->uri, r->server);*/ ! /*log_error(list[i].name, r->server);*/ } #if DEBUGGING { --- 299,315 ---- /* we only know how to handle communication to a proxy via http */ /*if (strcmp(scheme, "http") == 0)*/ { ! int ii; struct dirconn_entry *list=(struct dirconn_entry*)conf->dirconn->elts; /* if (*++p == '/' && *++p == '/') */ ! for (direct_connect=ii=0; ii < conf->dirconn->nelts && !direct_connect; ii++) { ! direct_connect = list[ii].matcher (&list[ii], r); /*log_error("URI and NoProxy:", r->server);*/ /*log_error(r->uri, r->server);*/ ! /*log_error(list[ii].name, r->server);*/ } #if DEBUGGING { 1.15 +2 -2 apache/src/modules/proxy/mod_proxy.h Index: mod_proxy.h =================================================================== RCS file: /export/home/cvs/apache/src/modules/proxy/mod_proxy.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C3 -r1.14 -r1.15 *** mod_proxy.h 1997/07/19 20:16:20 1.14 --- mod_proxy.h 1997/07/21 05:54:03 1.15 *************** *** 259,268 **** void proxy_c2hex(int ch, char *x); char *proxy_canonenc(pool *p, const char *x, int len, enum enctype t, int isenc); ! char *proxy_canon_netloc(pool *pool, char **const urlp, char **userp, char **passwordp, char **hostp, int *port); char *proxy_date_canon(pool *p, char *x); ! array_header *proxy_read_headers(pool *pool, char *buffer, int size, BUFF *f); long int proxy_send_fb(BUFF *f, request_rec *r, BUFF *f2, struct cache_req *c); struct hdr_entry *proxy_get_header(array_header *hdrs_arr, const char *name); struct hdr_entry *proxy_add_header(array_header *hdrs_arr, char *field, --- 259,268 ---- void proxy_c2hex(int ch, char *x); char *proxy_canonenc(pool *p, const char *x, int len, enum enctype t, int isenc); ! char *proxy_canon_netloc(pool *p, char **const urlp, char **userp, char **passwordp, char **hostp, int *port); char *proxy_date_canon(pool *p, char *x); ! array_header *proxy_read_headers(pool *p, char *buffer, int size, BUFF *f); long int proxy_send_fb(BUFF *f, request_rec *r, BUFF *f2, struct cache_req *c); struct hdr_entry *proxy_get_header(array_header *hdrs_arr, const char *name); struct hdr_entry *proxy_add_header(array_header *hdrs_arr, char *field, 1.21 +12 -11 apache/src/modules/proxy/proxy_cache.c Index: proxy_cache.c =================================================================== RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_cache.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C3 -r1.20 -r1.21 *** proxy_cache.c 1997/07/19 22:16:45 1.20 --- proxy_cache.c 1997/07/21 05:54:04 1.21 *************** *** 77,83 **** static int gcdiff(const void *ap, const void *bp) { ! const struct gc_ent *a=*(struct gc_ent **)ap, *b=*(struct gc_ent **)bp; if (a->expire > b->expire) return 1; else if (a->expire < b->expire) return -1; --- 77,84 ---- 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; if (a->expire > b->expire) return 1; else if (a->expire < b->expire) return -1; *************** *** 381,389 **** * -1 on UNIX error */ static int ! rdcache(pool *pool, BUFF *cachefp, struct cache_req *c) { ! char urlbuff[1034], *p; int len; /* read the data from the cache file */ /* format --- 382,390 ---- * -1 on UNIX error */ static int ! rdcache(pool *p, BUFF *cachefp, struct cache_req *c) { ! char urlbuff[1034], *strp; int len; /* read the data from the cache file */ /* format *************** *** 420,431 **** if (len == 0 || urlbuff[len-1] != '\n') return 0; urlbuff[--len] = '\0'; ! c->resp_line = pstrdup(pool, urlbuff); ! p = strchr(urlbuff, ' '); ! if (p == NULL) return 0; ! c->status = atoi(p); ! c->hdrs = proxy_read_headers(pool, urlbuff, 1034, cachefp); if (c->hdrs == NULL) return -1; if (c->len != -1) /* add a content-length header */ { --- 421,432 ---- if (len == 0 || urlbuff[len-1] != '\n') return 0; urlbuff[--len] = '\0'; ! c->resp_line = pstrdup(p, urlbuff); ! strp = strchr(urlbuff, ' '); ! if (strp == NULL) return 0; ! c->status = atoi(strp); ! c->hdrs = proxy_read_headers(p, urlbuff, 1034, cachefp); if (c->hdrs == NULL) return -1; if (c->len != -1) /* add a content-length header */ { *************** *** 433,441 **** q = proxy_get_header(c->hdrs, "Content-Length"); if (q == NULL) { ! p = palloc(pool, 15); ! ap_snprintf(p, 15, "%u", c->len); ! proxy_add_header(c->hdrs, "Content-Length", p, HDR_REP); } } return 1; --- 434,442 ---- q = proxy_get_header(c->hdrs, "Content-Length"); if (q == NULL) { ! strp = palloc(p, 15); ! ap_snprintf(strp, 15, "%u", c->len); ! proxy_add_header(c->hdrs, "Content-Length", strp, HDR_REP); } } return 1;