You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/06/26 03:21:46 UTC
fixes to assist building Apache-1.1b4 on SunOS-4.1, among other things (fwd)
I've asked him to join the list and break this up into small patches
for consideration..
-=-=-=
Message-Id: <m0...@most.weird.com>
Date: Tue, 25 Jun 96 19:47:48 -0400 (EDT)
From: woods@most.weird.com (Greg A. Woods)
To: apache-bugs@apache.org
Subject: fixes to assist building Apache-1.1b4 on SunOS-4.1, among other things
Reply-To: woods@planix.com (Greg A. Woods)
X-Mailer: ViewMail (vm) Version 5.72 (beta)
with GNU Emacs 19.28.1 (m68k-sun-sunos4.1.1_U1) of Thu Mar 9 1995 on most
Organization: Planix, Inc.; Toronto, Ontario; Canada
Once again I've embarked on the task of trying to build the latest
Apache server on SunOS-4.1 using only the native SunOS compiler.
I have succeeded without too much trouble, but with the assitance of
Wietse Venema's "unproto" tool.
I'd really love to be given a free hand to run through the code and
clean it up -- there's a lot of sloppy stuff in there, not to mention
that the number of variants of coding styles present is un-countable.
I'd also love to help re-design the configuration system to use GNU
autoconf and to properly package Apache so that it could be easily
installed in complete form from source on a variety of platforms.
Please let me know if you're interested. Do you by any chance use CVS
with remote access to manage the sources?
In any case I hope you find the following changes helpful. I will
continue to offer the patch unofficially, but I'd rather help you
integrate these changes into the code base.
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: apache-1.1b4-v0.ChangeLog apache-1.1b4-v0.diffs
# Wrapped by woods@most.weird.com on Tue Jun 25 17:01:53 1996
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'apache-1.1b4-v0.ChangeLog' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'apache-1.1b4-v0.ChangeLog'\"
else
echo shar: Extracting \"'apache-1.1b4-v0.ChangeLog'\" \(1682 characters\)
sed "s/^X//" >'apache-1.1b4-v0.ChangeLog' <<'END_OF_FILE'
XFri Jun 21 22:28:58 1996 Greg A. Woods <wo...@planix.com>
X
X * src/mod_status.c, src/mod_proxy.c, src/mod_imap.c, src/mod_dir.c,
X src/mod_cookies.c, src/http_protocol.c, src/http_config.c:
X - fix some pascal-isms that seem to be permitted by gcc (this is C!)
X
X * src/httpd.h:
X - make it possible to specify some settings on the cc command-line
X from Configuration
X - SunOS-4 portability fixes
X
X * src/http_main.c:
X - setuid becomes SETUID to help with really weird problem on SunOS-4
X (also print setuid() failure error to stderr if running with -X)
X - add some code that'll shut down the parent if too many children die
X too fast. (i.e. more than daemons_limit in 5 second intervals)
X - fix some pascal-isms that seem to be permitted by gcc (this is C!)
X - re-paragraph some code for readability (this code is horrid to read,
X and totally inconsistent throughout!)
X
X * src/http_log.c:
X - re-paragraph some code for readability (this code is horrid to read,
X and totally inconsistent throughout!)
X
X * src/http_bprintf.c:
X - fixes for SunOS portability (no such "long double"!!!!)
X
X * src/conf.h:
X - fixes for SunOS portability
X
X * src/buff.c:
X - include conf.h for memchr() declaration
X - cast memchr() properly for assignment
X - re-paragraph some code for readability (this code is horrid to read,
X and totally inconsistent throughout!)
X
X * src/.cvsignore:
X - first time in with default targets ignored....
X
X * src/Configuration:
X - copied from Configuration.tmpl and localized
X [XXX I'm not sure why this file is shipped when there's a template for it....]
X
X * conf/srm.conf-dist:
X - .f files are fortran files too! (unix f77)
X - add CVS and SCCS subdirectories to IndexIgnore
X
END_OF_FILE
if test 1682 -ne `wc -c <'apache-1.1b4-v0.ChangeLog'`; then
echo shar: \"'apache-1.1b4-v0.ChangeLog'\" unpacked with wrong size!
fi
# end of 'apache-1.1b4-v0.ChangeLog'
fi
if test -f 'apache-1.1b4-v0.diffs' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'apache-1.1b4-v0.diffs'\"
else
echo shar: Extracting \"'apache-1.1b4-v0.diffs'\" \(49774 characters\)
sed "s/^X//" >'apache-1.1b4-v0.diffs' <<'END_OF_FILE'
XIndex: misc/apache/conf/srm.conf-dist
Xdiff -c misc/apache/conf/srm.conf-dist:1.1.1.2 misc/apache/conf/srm.conf-dist:1.2
X*** misc/apache/conf/srm.conf-dist:1.1.1.2 Wed Jun 19 13:40:54 1996
X--- misc/apache/conf/srm.conf-dist Fri Jun 21 18:11:13 1996
X***************
X*** 48,54 ****
X AddIcon /icons/text.gif .txt
X AddIcon /icons/c.gif .c
X AddIcon /icons/p.gif .pl .py
X! AddIcon /icons/f.gif .for
X AddIcon /icons/dvi.gif .dvi
X AddIcon /icons/uuencoded.gif .uu
X AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
X--- 48,54 ----
X AddIcon /icons/text.gif .txt
X AddIcon /icons/c.gif .c
X AddIcon /icons/p.gif .pl .py
X! AddIcon /icons/f.gif .f .for
X AddIcon /icons/dvi.gif .dvi
X AddIcon /icons/uuencoded.gif .uu
X AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
X***************
X*** 84,90 ****
X # IndexIgnore is a set of filenames which directory indexing should ignore
X # Format: IndexIgnore name1 name2...
X
X! IndexIgnore */.??* *~ *# */HEADER* */README* */RCS
X
X # AccessFileName: The name of the file to look for in each directory
X # for access control information.
X--- 84,90 ----
X # IndexIgnore is a set of filenames which directory indexing should ignore
X # Format: IndexIgnore name1 name2...
X
X! IndexIgnore */.??* *~ *# */HEADER* */README* */RCS */SCCS */CVS
X
X # AccessFileName: The name of the file to look for in each directory
X # for access control information.
XIndex: misc/apache/src/.cvsignore
Xdiff -c /dev/null misc/apache/src/.cvsignore:1.1
X*** /dev/null Tue Jun 25 16:45:24 1996
X--- misc/apache/src/.cvsignore Fri Jun 21 18:12:56 1996
X***************
X*** 0 ****
X--- 1,3 ----
X+ Makefile
X+ httpd
X+ modules.c
XIndex: misc/apache/src/Configuration
Xdiff -c misc/apache/src/Configuration:1.1.1.4 misc/apache/src/Configuration:1.2
X*** misc/apache/src/Configuration:1.1.1.4 Wed Jun 19 13:42:17 1996
X--- misc/apache/src/Configuration Fri Jun 21 18:12:24 1996
X***************
X*** 17,26 ****
X # First, ordinary compile-time configuration.
X
X # What to call the compiler: For normal machines with ANSI compilers
X! # CC= cc
X # For Suns or other non-ANSI platforms. Please make sure your gcc is
X # 2.0 or later, as 1.40 seems to create bad code for the Sun 4.
X! CC= gcc
X
X # CFLAGS, compile flags.
X
X--- 17,26 ----
X # First, ordinary compile-time configuration.
X
X # What to call the compiler: For normal machines with ANSI compilers
X! CC= cc
X # For Suns or other non-ANSI platforms. Please make sure your gcc is
X # 2.0 or later, as 1.40 seems to create bad code for the Sun 4.
X! # CC= gcc
X
X # CFLAGS, compile flags.
X
X***************
X*** 65,75 ****
X # defaults in. Note that this config file does not include DBM auth by
X # default --- configure it in below if you need it].
X
X! CFLAGS= -O2
X
X # Place here any flags you may need upon linking, such as a flag to
X # prevent dynamic linking (if desired)
X! LFLAGS=
X
X # Place here any extra libraries you may need to link to.
X # -lndbm is commonly required for DBM auth, if that is configured in.
X--- 65,77 ----
X # defaults in. Note that this config file does not include DBM auth by
X # default --- configure it in below if you need it].
X
X! DEFS= -DSTATUS -DHTTPD_ROOT=\"/local/httpd\" -DDOCUMENT_LOCATION=\"/usr/local/httpd/htdocs\"
X
X+ CFLAGS= -g -Qpath /local/lib/unproto -I/local/include/unproto -Dconst= -Dvolatile= $(DEFS)
X+
X # Place here any flags you may need upon linking, such as a flag to
X # prevent dynamic linking (if desired)
X! LFLAGS= -g
X
X # Place here any extra libraries you may need to link to.
X # -lndbm is commonly required for DBM auth, if that is configured in.
X***************
X*** 80,86 ****
X # SETTINGS FOR THE SYSTEM FLAGS. IF YOU DON'T, BAD THINGS WILL HAPPEN.
X
X # For SunOS 4
X! #AUX_CFLAGS= -DSUNOS4
X # For Solaris 2.
X #AUX_CFLAGS= -DSOLARIS2
X #AUX_LIBS= -lsocket -lnsl
X--- 82,89 ----
X # SETTINGS FOR THE SYSTEM FLAGS. IF YOU DON'T, BAD THINGS WILL HAPPEN.
X
X # For SunOS 4
X! # add -DHAVE_STRERROR if you have integrated the shared resolver from BIND
X! AUX_CFLAGS= -DSUNOS4 -DHAVE_STRERROR
X # For Solaris 2.
X #AUX_CFLAGS= -DSOLARIS2
X #AUX_LIBS= -lsocket -lnsl
X***************
X*** 197,204 ****
X ## We recommend, however, that you migrate to the configurable logging
X ## module, below.
X
X! # Module agent_log_module mod_log_agent.o
X! # Module referer_log_module mod_log_referer.o
X
X ## This is a *replacement* for mod_log_common which supports a
X ## LogFormat directive which allows you to specify what goes into
X--- 200,207 ----
X ## We recommend, however, that you migrate to the configurable logging
X ## module, below.
X
X! Module agent_log_module mod_log_agent.o
X! Module referer_log_module mod_log_referer.o
X
X ## This is a *replacement* for mod_log_common which supports a
X ## LogFormat directive which allows you to specify what goes into
X***************
X*** 215,223 ****
X ## variables. The anon_auth module allows for anonymous-FTP-style username/
X ## password authentication.
X
X! # Module cern_meta_module mod_cern_meta.o
X! # Module env_module mod_env.o
X! # Module anon_auth_module mod_auth_anon.o
X
X ## The status module allows the server to display current details about
X ## how well it is performing and what it is doing. Consider also enabling
X--- 218,226 ----
X ## variables. The anon_auth module allows for anonymous-FTP-style username/
X ## password authentication.
X
X! Module cern_meta_module mod_cern_meta.o
X! Module env_module mod_env.o
X! Module anon_auth_module mod_auth_anon.o
X
X ## The status module allows the server to display current details about
X ## how well it is performing and what it is doing. Consider also enabling
X***************
X*** 224,235 ****
X ## -DSTATUS (see the CFLAGS section near the start of the file) to allow
X ## full status information. Check conf/access.conf on how to enable this.
X
X! # Module status_module mod_status.o
X
X ## The Info module displays configuration information for the server and
X ## all included modules. It's very useful for debugging.
X
X! # Module info_module mod_info.o
X
X ## Optional authentication modules, which should only be
X ## uncommented out if you have the neccessary system support.
X--- 227,238 ----
X ## -DSTATUS (see the CFLAGS section near the start of the file) to allow
X ## full status information. Check conf/access.conf on how to enable this.
X
X! Module status_module mod_status.o
X
X ## The Info module displays configuration information for the server and
X ## all included modules. It's very useful for debugging.
X
X! Module info_module mod_info.o
X
X ## Optional authentication modules, which should only be
X ## uncommented out if you have the neccessary system support.
X***************
X*** 239,248 ****
X ## Digest Authentication rather than the less secure Basic Auth
X ## used by the other modules.
X
X! # Module dbm_auth_module mod_auth_dbm.o
X # Module db_auth_module mod_auth_db.o
X # Module msql_auth_module mod_auth_msql.o
X! # Module digest_module mod_digest.o
X
X ## Outright experiments --- mod_dld defines commands which
X ## allows other modules to be loaded in at runtime, and mod_cookies
X--- 242,251 ----
X ## Digest Authentication rather than the less secure Basic Auth
X ## used by the other modules.
X
X! Module dbm_auth_module mod_auth_dbm.o
X # Module db_auth_module mod_auth_db.o
X # Module msql_auth_module mod_auth_msql.o
X! Module digest_module mod_digest.o
X
X ## Outright experiments --- mod_dld defines commands which
X ## allows other modules to be loaded in at runtime, and mod_cookies
X***************
X*** 251,262 ****
X ## aren't coming in via proxy.
X
X # Module dld_module mod_dld.o
X! # Module cookies_module mod_cookies.o
X
X ## Finally, the proxy module. It's not as complete as it could
X ## be yet, so use at your own risk.
X
X! # Module proxy_module mod_proxy.o
X!
X!
X!
X--- 254,262 ----
X ## aren't coming in via proxy.
X
X # Module dld_module mod_dld.o
X! Module cookies_module mod_cookies.o
X
X ## Finally, the proxy module. It's not as complete as it could
X ## be yet, so use at your own risk.
X
X! Module proxy_module mod_proxy.o
XIndex: misc/apache/src/buff.c
Xdiff -c misc/apache/src/buff.c:1.1.1.1 misc/apache/src/buff.c:1.2
X*** misc/apache/src/buff.c:1.1.1.1 Wed Jun 19 13:42:47 1996
X--- misc/apache/src/buff.c Fri Jun 21 18:15:43 1996
X***************
X*** 56,61 ****
X--- 56,62 ----
X #include <string.h>
X #include <unistd.h>
X
X+ #include "conf.h"
X #include "alloc.h"
X #include "buff.h"
X
X***************
X*** 356,366 ****
X errno = EINVAL;
X return -1;
X }
X! if (fb->flags & B_RDERR) return -1;
X
X for (;;)
X {
X! x = memchr(fb->inptr, '\012', fb->incnt);
X if (x != NULL)
X {
X x++;
X--- 357,368 ----
X errno = EINVAL;
X return -1;
X }
X! if (fb->flags & B_RDERR)
X! return -1;
X
X for (;;)
X {
X! x = (unsigned char *) memchr(fb->inptr, '\012', fb->incnt);
X if (x != NULL)
X {
X x++;
X***************
X*** 371,384 ****
X
X fb->inptr = fb->inbase;
X fb->incnt = 0;
X! if (fb->flags & B_EOF) return 0;
X! do i = read(fb->fd_in, fb->inptr, fb->bufsiz);
X! while (i == -1 && errno == EINTR);
X if (i == 0) fb->flags |= B_EOF;
X! if (i == -1 && errno != EAGAIN) doerror(fb, B_RD);
X! if (i == 0 || i == -1) return i;
X fb->incnt = i;
X }
X }
X
X /*
X--- 373,392 ----
X
X fb->inptr = fb->inbase;
X fb->incnt = 0;
X! if (fb->flags & B_EOF)
X! return 0;
X! do
X! i = read(fb->fd_in, fb->inptr, fb->bufsiz);
X! while (i == -1 && errno == EINTR)
X! ;
X if (i == 0) fb->flags |= B_EOF;
X! if (i == -1 && errno != EAGAIN)
X! doerror(fb, B_RD);
X! if (i == 0 || i == -1)
X! return i;
X fb->incnt = i;
X }
X+ /* NOTREACHED */
X }
X
X /*
XIndex: misc/apache/src/conf.h
Xdiff -c misc/apache/src/conf.h:1.1.1.5 misc/apache/src/conf.h:1.2
X*** misc/apache/src/conf.h:1.1.1.5 Wed Jun 19 13:42:49 1996
X--- misc/apache/src/conf.h Fri Jun 21 18:16:35 1996
X***************
X*** 60,76 ****
X #include <sys/param.h>
X #endif
X
X /* Define one of these according to your system. */
X #if defined(SUNOS4)
X! #define HAS_GMTOFF
X! #define HAVE_RESOURCE 1
X! #undef NO_KILLPG
X! #undef NO_SETSID
X char *crypt(char *pw, char *salt);
X- #define JMP_BUF sigjmp_buf
X- #define HAVE_MMAP
X- #include <sys/time.h>
X- #define NEED_STRERROR
X
X #elif defined(SOLARIS2)
X #undef HAS_GMTOFF
X--- 60,86 ----
X #include <sys/param.h>
X #endif
X
X+ #define SETUID(u1) setuid(u1)
X+
X /* Define one of these according to your system. */
X #if defined(SUNOS4)
X! # define HAS_GMTOFF 1
X! # define HAVE_RESOURCE 1
X! # undef NO_KILLPG
X! # undef NO_SETSID
X! # undef SETUID
X! # define SETUID(u1) setreuid(u1, u1) /* this sucks -- I don't know why it fails */
X! # define JMP_BUF sigjmp_buf
X! # define HAVE_MMAP 1
X! # include <sys/time.h>
X! # ifndef HAVE_STRERROR
X! # define NEED_STRERROR 1
X! # endif
X! # ifndef __GCC__
X! # define SUNOS_LIB_PROTOTYPES 1
X! # endif
X!
X char *crypt(char *pw, char *salt);
X
X #elif defined(SOLARIS2)
X #undef HAS_GMTOFF
X***************
X*** 451,460 ****
X
X #ifdef SUNOS_LIB_PROTOTYPES
X /* Prototypes needed to get a clean compile with gcc -Wall.
X! * Believe it or not, these do have to be declared, at least on SunOS,
X! * because they aren't mentioned in the relevant system headers.
X! * Sun Quality Software. Gotta love it.
X */
X
X int getopt (int, char **, char *);
X
X--- 461,472 ----
X
X #ifdef SUNOS_LIB_PROTOTYPES
X /* Prototypes needed to get a clean compile with gcc -Wall.
X! * these do have to be declared, at least on SunOS, and on many other
X! * older unix systems because they aren't mentioned in the relevant
X! * system headers.
X */
X+
X+ # include <memory.h>
X
X int getopt (int, char **, char *);
X
XIndex: misc/apache/src/http_bprintf.c
Xdiff -c misc/apache/src/http_bprintf.c:1.1.1.1 misc/apache/src/http_bprintf.c:1.2
X*** misc/apache/src/http_bprintf.c:1.1.1.1 Wed Jun 19 13:42:52 1996
X--- misc/apache/src/http_bprintf.c Fri Jun 21 18:17:19 1996
X***************
X*** 27,33 ****
X #define max(a,b) (a > b ? a : b)
X #endif
X
X! #define LONG_DOUBLE long double
X
X #define FALSE 0
X #define TRUE 1
X--- 27,37 ----
X #define max(a,b) (a > b ? a : b)
X #endif
X
X! #ifdef __GNUC__
X! # define LONG_DOUBLE long double /* XXX FIXME: what the heck?!?!?!? */
X! #else
X! # define LONG_DOUBLE double /* this is already like a "long float"! */
X! #endif
X
X #define FALSE 0
X #define TRUE 1
XIndex: misc/apache/src/http_config.c
Xdiff -c misc/apache/src/http_config.c:1.1.1.5 misc/apache/src/http_config.c:1.2
X*** misc/apache/src/http_config.c:1.1.1.5 Wed Jun 19 13:42:57 1996
X--- misc/apache/src/http_config.c Fri Jun 21 18:28:32 1996
X***************
X*** 268,275 ****
X {
X module *modp;
X handler_rec *handp;
X! char *content_type = r->content_type ? r->content_type : default_type (r);
X! char *handler = r->handler ? r->handler : content_type;
X
X /* Pass one --- direct matches */
X
X--- 268,278 ----
X {
X module *modp;
X handler_rec *handp;
X! char *content_type;
X! char *my_handler;
X!
X! content_type = r->content_type ? r->content_type : default_type (r);
X! my_handler = r->handler ? r->handler : content_type;
X
X /* Pass one --- direct matches */
X
X***************
X*** 278,284 ****
X if (!modp->handlers) continue;
X
X for (handp = modp->handlers; handp->content_type; ++handp) {
X! if (!strcasecmp (handler, handp->content_type)) {
X int result = (*handp->handler)(r);
X
X if (result != DECLINED) return result;
X--- 281,287 ----
X if (!modp->handlers) continue;
X
X for (handp = modp->handlers; handp->content_type; ++handp) {
X! if (!strcasecmp (my_handler, handp->content_type)) {
X int result = (*handp->handler)(r);
X
X if (result != DECLINED) return result;
X***************
X*** 300,306 ****
X
X len = starp - handp->content_type;
X
X! if (!len || !strncasecmp (handler, handp->content_type, len))
X {
X int result = (*handp->handler)(r);
X
X--- 303,309 ----
X
X len = starp - handp->content_type;
X
X! if (!len || !strncasecmp (my_handler, handp->content_type, len))
X {
X int result = (*handp->handler)(r);
X
XIndex: misc/apache/src/http_log.c
Xdiff -c misc/apache/src/http_log.c:1.1.1.3 misc/apache/src/http_log.c:1.2
X*** misc/apache/src/http_log.c:1.1.1.3 Wed Jun 19 13:43:17 1996
X--- misc/apache/src/http_log.c Fri Jun 21 18:18:50 1996
X***************
X*** 163,169 ****
X fprintf(s->error_log, "[%s] %s: %s: %s\n", q, routine, file, p);
X else
X fprintf(s->error_log, "[%s] %s: %s\n", q, routine, p);
X! if (msg != NULL) fprintf(s->error_log, "[%s] - %s\n", q, msg);
X
X fflush(s->error_log);
X }
X--- 163,170 ----
X fprintf(s->error_log, "[%s] %s: %s: %s\n", q, routine, file, p);
X else
X fprintf(s->error_log, "[%s] %s: %s\n", q, routine, p);
X! if (msg != NULL)
X! fprintf(s->error_log, "[%s] - %s\n", q, msg);
X
X fflush(s->error_log);
X }
XIndex: misc/apache/src/http_main.c
Xdiff -c misc/apache/src/http_main.c:1.1.1.5 misc/apache/src/http_main.c:1.2
X*** misc/apache/src/http_main.c:1.1.1.5 Wed Jun 19 13:43:21 1996
X--- misc/apache/src/http_main.c Fri Jun 21 18:23:35 1996
X***************
X*** 88,93 ****
X--- 88,94 ----
X #include "http_core.h" /* for get_remote_host */
X #include "scoreboard.h"
X #include <setjmp.h>
X+ #include <sys/time.h>
X #ifdef HAVE_SHMGET
X #include <sys/types.h>
X #include <sys/ipc.h>
X***************
X*** 742,750 ****
X #if defined(STATUS)
X void increment_counts (int child_num, request_rec *r, int flag)
X {
X! long int bs=0;
X! short_score new_score_rec=scoreboard_image[child_num];
X
X if (r->sent_bodyct)
X bgetopt(r->connection->client, BO_BYTECT, &bs);
X
X--- 743,753 ----
X #if defined(STATUS)
X void increment_counts (int child_num, request_rec *r, int flag)
X {
X! long int bs = 0;
X! short_score new_score_rec;
X
X+ new_score_rec = scoreboard_image[child_num];
X+
X if (r->sent_bodyct)
X bgetopt(r->connection->client, BO_BYTECT, &bs);
X
X***************
X*** 1140,1146 ****
X (void)update_child_status (child_num, SERVER_READY, (request_rec*)NULL);
X
X /* Only try to switch if we're running as root */
X! if(!geteuid() && setuid(user_id) == -1) {
X log_unixerr("setuid", NULL, "unable to change uid", server_conf);
X exit (1);
X }
X--- 1143,1153 ----
X (void)update_child_status (child_num, SERVER_READY, (request_rec*)NULL);
X
X /* Only try to switch if we're running as root */
X! if(!geteuid() && SETUID(user_id) == -1) {
X! if (one_process) {
X! fprintf(stderr, "setuid(%d) failed: ", user_id);
X! perror("");
X! }
X log_unixerr("setuid", NULL, "unable to change uid", server_conf);
X exit (1);
X }
X***************
X*** 1431,1459 ****
X
X log_error ("Server configured -- resuming normal operations", server_conf);
X
X! while (1) {
X! int status, child_slot;
X! int pid = wait_or_timeout(&status);
X!
X! if (pid >= 0) {
X! /* Child died... note that it's gone in the scoreboard. */
X! sync_scoreboard_image();
X! child_slot = find_child_by_pid (pid);
X! if (child_slot >= 0)
X! (void)update_child_status (child_slot, SERVER_DEAD,
X! (request_rec*)NULL);
X! }
X!
X! sync_scoreboard_image();
X! if ((count_idle_servers() < daemons_min_free)
X! && (child_slot = find_free_child_num()) >= 0
X! && child_slot <= daemons_limit) {
X! (void)update_child_status(child_slot,SERVER_STARTING,
X! (request_rec*)NULL);
X! make_child(server_conf, child_slot);
X }
X! }
X!
X } /* standalone_main */
X
X extern char *optarg;
X--- 1438,1490 ----
X
X log_error ("Server configured -- resuming normal operations", server_conf);
X
X! while (1) {
X! static int fail_count = 0;
X! static time_t last_death = 0;
X! time_t tstamp;
X! int status, child_slot;
X! int pid = wait_or_timeout(&status);
X!
X! if (pid >= 0) {
X! /* Child died... */
X! (void) time(&tstamp);
X! if (++fail_count == daemons_limit &&
X! tstamp < last_death + 5) {
X! log_unixerr("main()", (char *) NULL,
X! "Too many children are dying! Exiting!",
X! server_conf);
X! cleanup_scoreboard();
X! #ifndef NO_KILLPG
X! killpg(pgrp, SIGKILL);
X! #else
X! kill(-pgrp, SIGKILL);
X! #endif
X! shutdown(sd, 2);
X! close(sd);
X! exit(1);
X! } else if (tstamp > last_death + 600) /* XXX: ten minutes enough? */
X! fail_count = 1;
X! last_death = tstamp;
X! /* note that it's gone in the scoreboard. */
X! sync_scoreboard_image();
X! child_slot = find_child_by_pid(pid);
X! if (child_slot >= 0) {
X! (void) update_child_status(child_slot, SERVER_DEAD,
X! (request_rec*) NULL);
X! }
X! }
X!
X! sync_scoreboard_image();
X! if ((count_idle_servers() < daemons_min_free) &&
X! (child_slot = find_free_child_num()) >= 0 &&
X! child_slot <= daemons_limit) {
X! (void) update_child_status(child_slot, SERVER_STARTING,
X! (request_rec*) NULL);
X! make_child(server_conf, child_slot);
X! }
X }
X! /* NOTREACHED */
X!
X } /* standalone_main */
X
X extern char *optarg;
X***************
X*** 1496,1502 ****
X break;
X case 'v':
X printf("Server version %s.\n",SERVER_VERSION);
X! exit(1);
X case 'X':
X ++one_process; /* Weird debugging mode. */
X break;
X--- 1527,1533 ----
X break;
X case 'v':
X printf("Server version %s.\n",SERVER_VERSION);
X! exit(1); /* XXX: why not 0? */
X case 'X':
X ++one_process; /* Weird debugging mode. */
X break;
X***************
X*** 1528,1538 ****
X set_group_privs();
X default_server_hostnames (server_conf);
X
X! /* Only try to switch if we're running as root */
X! if(!geteuid() && setuid(user_id) == -1) {
X! log_unixerr("setuid", NULL, "unable to change uid", server_conf);
X! exit (1);
X! }
X
X c = sizeof(sa_client);
X if ((getpeername(fileno(stdin), &sa_client, &c)) < 0)
X--- 1559,1573 ----
X set_group_privs();
X default_server_hostnames (server_conf);
X
X! /* Only try to switch if we're running as root */
X! if(!geteuid() && SETUID(user_id) == -1) {
X! if (one_process) {
X! fprintf(stderr, "setuid(%d) failed: ", user_id);
X! perror("");
X! }
X! log_unixerr("setuid", NULL, "unable to change uid", server_conf);
X! exit (1);
X! }
X
X c = sizeof(sa_client);
X if ((getpeername(fileno(stdin), &sa_client, &c)) < 0)
XIndex: misc/apache/src/http_protocol.c
Xdiff -c misc/apache/src/http_protocol.c:1.1.1.4 misc/apache/src/http_protocol.c:1.2
X*** misc/apache/src/http_protocol.c:1.1.1.4 Wed Jun 19 13:43:30 1996
X--- misc/apache/src/http_protocol.c Fri Jun 21 18:28:36 1996
X***************
X*** 331,337 ****
X char l[HUGE_STRING_LEN];
X char *ll = l, *uri;
X conn_rec *conn = r->connection;
X! int major = 1, minor = 0; /* Assume HTTP/1.0 if non-"HTTP" protocol*/
X
X l[0] = '\0';
X if(!getline(l, HUGE_STRING_LEN, conn->client))
X--- 331,337 ----
X char l[HUGE_STRING_LEN];
X char *ll = l, *uri;
X conn_rec *conn = r->connection;
X! int proto_ver_major = 1, proto_ver_minor = 0; /* Assume HTTP/1.0 if non-"HTTP" protocol*/
X
X l[0] = '\0';
X if(!getline(l, HUGE_STRING_LEN, conn->client))
X***************
X*** 347,354 ****
X
X r->assbackwards = (ll[0] == '\0');
X r->protocol = pstrdup (r->pool, ll[0] ? ll : "HTTP/0.9");
X! sscanf(r->protocol, "HTTP/%d.%d", &major, &minor);
X! r->proto_num = 1000*major + minor;
X
X return 1;
X }
X--- 347,354 ----
X
X r->assbackwards = (ll[0] == '\0');
X r->protocol = pstrdup (r->pool, ll[0] ? ll : "HTTP/0.9");
X! sscanf(r->protocol, "HTTP/%d.%d", &proto_ver_major, &proto_ver_minor);
X! r->proto_num = 1000 * proto_ver_major + proto_ver_minor;
X
X return 1;
X }
XIndex: misc/apache/src/httpd.h
Xdiff -c misc/apache/src/httpd.h:1.1.1.5 misc/apache/src/httpd.h:1.2
X*** misc/apache/src/httpd.h:1.1.1.5 Wed Jun 19 13:43:45 1996
X--- misc/apache/src/httpd.h Fri Jun 21 18:26:25 1996
X***************
X*** 67,85 ****
X /* Define this to be the default server home dir. Anything later in this
X * file with a relative pathname will have this added.
X */
X! #ifdef __EMX__
X! /* Set default for OS/2 file system */
X! #define HTTPD_ROOT "/os2httpd"
X! #else
X! #define HTTPD_ROOT "/usr/local/etc/httpd"
X #endif
X
X /* Root of server */
X! #ifdef __EMX__
X! /* Set default for OS/2 file system */
X! #define DOCUMENT_LOCATION "/os2httpd/docs"
X! #else
X! #define DOCUMENT_LOCATION "/usr/local/etc/httpd/htdocs"
X #endif
X
X /* Max. number of dynamically loaded modules */
X--- 67,87 ----
X /* Define this to be the default server home dir. Anything later in this
X * file with a relative pathname will have this added.
X */
X! #ifndef HTTPD_ROOT
X! # ifdef __EMX__
X! # define HTTPD_ROOT "/os2httpd" /* Set default for OS/2 */
X! # else
X! # define HTTPD_ROOT "/usr/local/httpd"
X! # endif
X #endif
X
X /* Root of server */
X! #ifndef DOCUMENT_LOCATION
X! # ifdef __EMX__
X! # define DOCUMENT_LOCATION "/os2httpd/docs" /* Set default for OS/2 */
X! # else
X! # define DOCUMENT_LOCATION "/usr/local/httpd/htdocs"
X! # endif
X #endif
X
X /* Max. number of dynamically loaded modules */
X***************
X*** 86,92 ****
X #define DYNAMIC_MODULE_LIMIT 64
X
X /* Default administrator's address */
X! #define DEFAULT_ADMIN "[no address given]"
X
X /*
X * --------- You shouldn't have to edit anything below this line ----------
X--- 88,96 ----
X #define DYNAMIC_MODULE_LIMIT 64
X
X /* Default administrator's address */
X! #ifndef DEFAULT_ADMIN
X! # define DEFAULT_ADMIN "[no address given]"
X! #endif
X
X /*
X * --------- You shouldn't have to edit anything below this line ----------
X***************
X*** 104,111 ****
X /* --------- Default user name and group name running standalone ---------- */
X /* --- These may be specified as numbers by placing a # before a number --- */
X
X! #define DEFAULT_USER "#-1"
X! #define DEFAULT_GROUP "#-1"
X
X /* The name of the log files */
X #ifdef __EMX__
X--- 108,120 ----
X /* --------- Default user name and group name running standalone ---------- */
X /* --- These may be specified as numbers by placing a # before a number --- */
X
X! #ifdef SUNOS4
X! # define DEFAULT_USER "nobody"
X! # define DEFAULT_GROUP "nogroup"
X! #else
X! # define DEFAULT_USER "#-1"
X! # define DEFAULT_GROUP "#-1"
X! #endif
X
X /* The name of the log files */
X #ifdef __EMX__
X***************
X*** 127,133 ****
X #define DEFAULT_INDEX "index.html"
X
X /* Define this to 1 if you want fancy indexing, 0 otherwise */
X! #define DEFAULT_INDEXING 0
X
X /* Define this to be what type you'd like returned for files with unknown */
X /* suffixes */
X--- 136,142 ----
X #define DEFAULT_INDEX "index.html"
X
X /* Define this to 1 if you want fancy indexing, 0 otherwise */
X! #define DEFAULT_INDEXING 1
X
X /* Define this to be what type you'd like returned for files with unknown */
X /* suffixes */
X***************
X*** 159,165 ****
X #define DEFAULT_USER_DIR "public_html"
X
X /* The default path for CGI scripts if none is currently set */
X! #define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
X
X /* The path to the Bourne shell, for parsed docs */
X #ifdef __EMX__
X--- 168,178 ----
X #define DEFAULT_USER_DIR "public_html"
X
X /* The default path for CGI scripts if none is currently set */
X! #ifdef SUNOS4
X! # define DEFAULT_PATH "/usr/5bin:/usr/bin:/usr/ucb:/local/bin:/local/gnu/bin"
X! #else
X! # define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
X! #endif
X
X /* The path to the Bourne shell, for parsed docs */
X #ifdef __EMX__
X***************
X*** 166,172 ****
X /* Set default for OS/2 file system */
X #define SHELL_PATH "CMD.EXE"
X #else
X! #define SHELL_PATH "/bin/sh"
X #endif
X
X /* The default string lengths */
X--- 179,189 ----
X /* Set default for OS/2 file system */
X #define SHELL_PATH "CMD.EXE"
X #else
X! # ifdef SUNOS4
X! # define SHELL_PATH "/usr/bin/sh"
X! # else
X! # define SHELL_PATH "/bin/sh"
X! # endif
X #endif
X
X /* The default string lengths */
XIndex: misc/apache/src/mod_cookies.c
Xdiff -c misc/apache/src/mod_cookies.c:1.1.1.3 misc/apache/src/mod_cookies.c:1.2
X*** misc/apache/src/mod_cookies.c:1.1.1.3 Wed Jun 19 13:44:12 1996
X--- misc/apache/src/mod_cookies.c Fri Jun 21 18:28:41 1996
X***************
X*** 1,4 ****
X-
X /* ====================================================================
X * Copyright (c) 1995, 1996 The Apache Group. All rights reserved.
X *
X--- 1,3 ----
X***************
X*** 127,133 ****
X get_remote_host(r->connection, r->per_dir_config,
X REMOTE_NAME));
X
X! struct timezone tz = { 0 , 0 };
X
X if ((dot = strchr(rname,'.'))) *dot='\0'; /* First bit of hostname */
X gettimeofday(&tv, &tz);
X--- 126,132 ----
X get_remote_host(r->connection, r->per_dir_config,
X REMOTE_NAME));
X
X! struct timezone tz;
X
X if ((dot = strchr(rname,'.'))) *dot='\0'; /* First bit of hostname */
X gettimeofday(&tv, &tz);
XIndex: misc/apache/src/mod_dir.c
Xdiff -c misc/apache/src/mod_dir.c:1.1.1.5 misc/apache/src/mod_dir.c:1.2
X*** misc/apache/src/mod_dir.c:1.1.1.5 Wed Jun 19 13:44:16 1996
X--- misc/apache/src/mod_dir.c Fri Jun 21 18:28:44 1996
X***************
X*** 51,57 ****
X *
X */
X
X-
X /*
X * http_dir.c: Handles the on-the-fly html index generation
X *
X--- 51,56 ----
X***************
X*** 617,625 ****
X t2 = pstrcat(scratch, t2, "</A>", NULL);
X } else
X {
X! char buff[24]=" ";
X t2 = escape_html(scratch, t);
X! buff[23-len] = '\0';
X t2 = pstrcat(scratch, t2, "</A>", buff, NULL);
X }
X anchor = pstrcat (scratch, "<A HREF=\"",
X--- 616,626 ----
X t2 = pstrcat(scratch, t2, "</A>", NULL);
X } else
X {
X! char buff[24];
X!
X! memset(buff, ' ', sizeof(buff));
X t2 = escape_html(scratch, t);
X! buff[sizeof(buff)-len] = '\0';
X t2 = pstrcat(scratch, t2, "</A>", buff, NULL);
X }
X anchor = pstrcat (scratch, "<A HREF=\"",
XIndex: misc/apache/src/mod_imap.c
Xdiff -c misc/apache/src/mod_imap.c:1.1.1.4 misc/apache/src/mod_imap.c:1.2
X*** misc/apache/src/mod_imap.c:1.1.1.4 Wed Jun 19 13:44:25 1996
X--- misc/apache/src/mod_imap.c Fri Jun 21 18:28:47 1996
X***************
X*** 363,369 ****
X char *string_pos = NULL;
X char *directory = NULL;
X char *referer = NULL;
X! char my_base[SMALLBUF] = {'\0'};
X
X if ( ! strcasecmp(value, "map" ) || ! strcasecmp(value, "menu") ) {
X if (r->server->port == 80 ) {
X--- 363,369 ----
X char *string_pos = NULL;
X char *directory = NULL;
X char *referer = NULL;
X! char my_base[SMALLBUF];
X
X if ( ! strcasecmp(value, "map" ) || ! strcasecmp(value, "menu") ) {
X if (r->server->port == 80 ) {
X***************
X*** 600,625 ****
X
X int imap_handler(request_rec *r)
X {
X! char input[LARGEBUF] = {'\0'};
X! char href_text[SMALLBUF] = {'\0'};
X! char base[SMALLBUF] = {'\0'};
X! char redirect[SMALLBUF] = {'\0'};
X! char directive[SMALLBUF] = {'\0'};
X! char value[SMALLBUF] = {'\0'};
X! char mapdflt[SMALLBUF] = {'\0'};
X! char closest[SMALLBUF] = {'\0'};
X double closest_yet = -1;
X!
X! double testpoint[2] = { -1,-1 };
X! double pointarray[MAXVERTS + 1][2] = { {-1,-1} };
X! int vertex = 0;
X!
X char *string_pos = NULL;
X int chars_read = 0;
X int showmenu = 0;
X-
X imap_conf_rec *icr = get_module_config(r->per_dir_config, &imap_module);
X-
X char *imap_menu = icr->imap_menu ?
X icr->imap_menu : IMAP_MENU_DEFAULT;
X char *imap_default = icr->imap_default ?
X--- 600,621 ----
X
X int imap_handler(request_rec *r)
X {
X! char input[LARGEBUF];
X! char href_text[SMALLBUF];
X! char base[SMALLBUF];
X! char redirect[SMALLBUF];
X! char directive[SMALLBUF];
X! char value[SMALLBUF];
X! char mapdflt[SMALLBUF];
X! char closest[SMALLBUF];
X double closest_yet = -1;
X! double testpoint[2];
X! double pointarray[MAXVERTS + 1][2];
X! int vertex;
X char *string_pos = NULL;
X int chars_read = 0;
X int showmenu = 0;
X imap_conf_rec *icr = get_module_config(r->per_dir_config, &imap_module);
X char *imap_menu = icr->imap_menu ?
X icr->imap_menu : IMAP_MENU_DEFAULT;
X char *imap_default = icr->imap_default ?
X***************
X*** 626,633 ****
X icr->imap_default : IMAP_DEFAULT_DEFAULT;
X char *imap_base = icr->imap_base ?
X icr->imap_base : IMAP_BASE_DEFAULT;
X-
X FILE *imap = pfopen(r->pool, r->filename, "r");
X
X if ( ! imap )
X return NOT_FOUND;
X--- 622,635 ----
X icr->imap_default : IMAP_DEFAULT_DEFAULT;
X char *imap_base = icr->imap_base ?
X icr->imap_base : IMAP_BASE_DEFAULT;
X FILE *imap = pfopen(r->pool, r->filename, "r");
X+
X+ testpoint[0] = -1;
X+ testpoint[1] = -1;
X+ for (vertex = 0; vertex < MAXVERTS + 1; vertex++) {
X+ pointarray[vertex][0] = -1;
X+ pointarray[vertex][1] = -1;
X+ }
X
X if ( ! imap )
X return NOT_FOUND;
XIndex: misc/apache/src/mod_proxy.c
Xdiff -c misc/apache/src/mod_proxy.c:1.1.1.1 misc/apache/src/mod_proxy.c:1.2
X*** misc/apache/src/mod_proxy.c:1.1.1.1 Wed Jun 19 13:45:03 1996
X--- misc/apache/src/mod_proxy.c Fri Jun 21 18:28:52 1996
X***************
X*** 478,484 ****
X * Returns an error string.
X */
X static char *
X! canon_netloc(pool *pool, char **const urlp, char **userp, char **passwordp,
X char **hostp, int *port)
X {
X int i;
X--- 478,484 ----
X * Returns an error string.
X */
X static char *
X! canon_netloc(pool *pl, char **const urlp, char **userp, char **passwordp,
X char **hostp, int *port)
X {
X int i;
X***************
X*** 508,519 ****
X if (p != NULL)
X {
X *p = '\0';
X! password = canonenc(pool, p+1, strlen(p+1), enc_user, 1);
X if (password == NULL)
X return "Bad %-escape in URL (password)";
X }
X
X! user = canonenc(pool, user, strlen(user), enc_user, 1);
X if (user == NULL) return "Bad %-escape in URL (username)";
X }
X *userp = user;
X--- 508,519 ----
X if (p != NULL)
X {
X *p = '\0';
X! password = canonenc(pl, p+1, strlen(p+1), enc_user, 1);
X if (password == NULL)
X return "Bad %-escape in URL (password)";
X }
X
X! user = canonenc(pl, user, strlen(user), enc_user, 1);
X if (user == NULL) return "Bad %-escape in URL (username)";
X }
X *userp = user;
X***************
X*** 770,776 ****
X * Returns NULL on file error
X */
X static array_header *
X! read_headers(pool *pool, char *buffer, int size, BUFF *f)
X {
X int gotcr, len, i, j;
X array_header *resp_hdrs;
X--- 770,776 ----
X * Returns NULL on file error
X */
X static array_header *
X! read_headers(pool *pl, char *buffer, int size, BUFF *f)
X {
X int gotcr, len, i, j;
X array_header *resp_hdrs;
X***************
X*** 777,783 ****
X struct hdr_entry *hdr;
X char *p;
X
X! resp_hdrs = make_array(pool, 10, sizeof(struct hdr_entry));
X hdr = NULL;
X
X gotcr = 1;
X--- 777,783 ----
X struct hdr_entry *hdr;
X char *p;
X
X! resp_hdrs = make_array(pl, 10, sizeof(struct hdr_entry));
X hdr = NULL;
X
X gotcr = 1;
X***************
X*** 807,813 ****
X gotcr = 1;
X continue;
X }
X! hdr->value = pstrcat(pool, hdr->value, buffer, NULL);
X }
X else if (gotcr && len == 0) break;
X else
X--- 807,813 ----
X gotcr = 1;
X continue;
X }
X! hdr->value = pstrcat(pl, hdr->value, buffer, NULL);
X }
X else if (gotcr && len == 0) break;
X else
X***************
X*** 827,835 ****
X }
X hdr = push_array(resp_hdrs);
X *(p++) = '\0';
X! hdr->field = pstrdup(pool, buffer);
X while (*p == ' ' || *p == '\t') p++;
X! hdr->value = pstrdup(pool, p);
X gotcr = i;
X }
X }
X--- 827,835 ----
X }
X hdr = push_array(resp_hdrs);
X *(p++) = '\0';
X! hdr->field = pstrdup(pl, buffer);
X while (*p == ' ' || *p == '\t') p++;
X! hdr->value = pstrdup(pl, p);
X gotcr = i;
X }
X }
X***************
X*** 1012,1018 ****
X char tmp[22];
X int i, k, d;
X unsigned int x;
X! static const char table[64]=
X "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@";
X
X MD5Init(&context);
X--- 1012,1018 ----
X char tmp[22];
X int i, k, d;
X unsigned int x;
X! static const char *chtable=
X "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@";
X
X MD5Init(&context);
X***************
X*** 1026,1040 ****
X for (i=0, k=0; i < 15; i += 3)
X {
X x = (digest[i] << 16) | (digest[i+1] << 8) | digest[i+2];
X! tmp[k++] = table[x >> 18];
X! tmp[k++] = table[(x >> 12) & 0x3f];
X! tmp[k++] = table[(x >> 6) & 0x3f];
X! tmp[k++] = table[x & 0x3f];
X }
X /* one byte left */
X x = digest[15];
X! tmp[k++] = table[x >> 2]; /* use up 6 bits */
X! tmp[k++] = table[(x << 4) & 0x3f];
X /* now split into directory levels */
X
X for(i=k=d=0 ; d < ndepth ; ++d)
X--- 1026,1040 ----
X for (i=0, k=0; i < 15; i += 3)
X {
X x = (digest[i] << 16) | (digest[i+1] << 8) | digest[i+2];
X! tmp[k++] = chtable[x >> 18];
X! tmp[k++] = chtable[(x >> 12) & 0x3f];
X! tmp[k++] = chtable[(x >> 6) & 0x3f];
X! tmp[k++] = chtable[x & 0x3f];
X }
X /* one byte left */
X x = digest[15];
X! tmp[k++] = chtable[x >> 2]; /* use up 6 bits */
X! tmp[k++] = chtable[(x << 4) & 0x3f];
X /* now split into directory levels */
X
X for(i=k=d=0 ; d < ndepth ; ++d)
X***************
X*** 1158,1164 ****
X {
X int mint, mon, year;
X struct tm x;
X! const int months[12]={
X ('J' << 16) | ( 'a' << 8) | 'n', ('F' << 16) | ( 'e' << 8) | 'b',
X ('M' << 16) | ( 'a' << 8) | 'r', ('A' << 16) | ( 'p' << 8) | 'r',
X ('M' << 16) | ( 'a' << 8) | 'y', ('J' << 16) | ( 'u' << 8) | 'n',
X--- 1158,1164 ----
X {
X int mint, mon, year;
X struct tm x;
X! static const int months[12]={
X ('J' << 16) | ( 'a' << 8) | 'n', ('F' << 16) | ( 'e' << 8) | 'b',
X ('M' << 16) | ( 'a' << 8) | 'r', ('A' << 16) | ( 'p' << 8) | 'r',
X ('M' << 16) | ( 'a' << 8) | 'y', ('J' << 16) | ( 'u' << 8) | 'n',
X***************
X*** 1528,1534 ****
X * -1 on UNIX error
X */
X static int
X! rdcache(pool *pool, BUFF *cachefp, struct cache_req *c)
X {
X char urlbuff[1034], *p;
X int len;
X--- 1528,1534 ----
X * -1 on UNIX error
X */
X static int
X! rdcache(pool *pl, BUFF *cachefp, struct cache_req *c)
X {
X char urlbuff[1034], *p;
X int len;
X***************
X*** 1566,1577 ****
X if (len == 0 || urlbuff[len-1] != '\n') return 0;
X urlbuff[--len] = '\0';
X
X! c->resp_line = pstrdup(pool, urlbuff);
X p = strchr(urlbuff, ' ');
X if (p == NULL) return 0;
X
X c->status = atoi(p);
X! c->hdrs = read_headers(pool, urlbuff, 1034, cachefp);
X if (c->hdrs == NULL) return -1;
X if (c->len != -1) /* add a content-length header */
X {
X--- 1566,1577 ----
X if (len == 0 || urlbuff[len-1] != '\n') return 0;
X urlbuff[--len] = '\0';
X
X! c->resp_line = pstrdup(pl, urlbuff);
X p = strchr(urlbuff, ' ');
X if (p == NULL) return 0;
X
X c->status = atoi(p);
X! c->hdrs = read_headers(pl, urlbuff, 1034, cachefp);
X if (c->hdrs == NULL) return -1;
X if (c->len != -1) /* add a content-length header */
X {
X***************
X*** 1579,1585 ****
X q = get_header(c->hdrs, "Content-Length");
X if (q == NULL)
X {
X! p = palloc(pool, 15);
X sprintf(p, "%u", c->len);
X add_header(c->hdrs, "Content-Length", p, HDR_REP);
X }
X--- 1579,1585 ----
X q = get_header(c->hdrs, "Content-Length");
X if (q == NULL)
X {
X! p = palloc(pl, 15);
X sprintf(p, "%u", c->len);
X add_header(c->hdrs, "Content-Length", p, HDR_REP);
X }
X***************
X*** 2290,2296 ****
X struct hdr_entry *hdr;
X array_header *resp_hdrs;
X BUFF *f, *cache, *data;
X! pool *pool=r->pool;
X const int one=1;
X const long int zero=0L;
X
X--- 2290,2296 ----
X struct hdr_entry *hdr;
X array_header *resp_hdrs;
X BUFF *f, *cache, *data;
X! pool *pl=r->pool;
X const int one=1;
X const long int zero=0L;
X
X***************
X*** 2352,2358 ****
X log_uerror("socket", NULL, "proxy: error creating socket", r->server);
X return SERVER_ERROR;
X }
X! note_cleanups_for_fd(pool, sock);
X
X if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&one,
X sizeof(int)) == -1)
X--- 2352,2358 ----
X log_uerror("socket", NULL, "proxy: error creating socket", r->server);
X return SERVER_ERROR;
X }
X! note_cleanups_for_fd(pl, sock);
X
X if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&one,
X sizeof(int)) == -1)
X***************
X*** 2359,2365 ****
X {
X log_uerror("setsockopt", NULL, "proxy: error setting reuseaddr option",
X r->server);
X! pclosef(pool, sock);
X return SERVER_ERROR;
X }
X
X--- 2359,2365 ----
X {
X log_uerror("setsockopt", NULL, "proxy: error setting reuseaddr option",
X r->server);
X! pclosef(pl, sock);
X return SERVER_ERROR;
X }
X
X***************
X*** 2366,2372 ****
X i = doconnect(sock, &server, r);
X if (i == -1) return proxyerror(r, "Could not connect to remote machine");
X
X! f = bcreate(pool, B_RDWR);
X bpushfd(f, sock, sock);
X /* shouldn't we implement telnet control options here? */
X
X--- 2366,2372 ----
X i = doconnect(sock, &server, r);
X if (i == -1) return proxyerror(r, "Could not connect to remote machine");
X
X! f = bcreate(pl, B_RDWR);
X bpushfd(f, sock, sock);
X /* shouldn't we implement telnet control options here? */
X
X***************
X*** 2454,2460 ****
X {
X log_uerror("getsockname", NULL,"proxy: error getting socket address",
X r->server);
X! pclosef(pool, sock);
X return SERVER_ERROR;
X }
X
X--- 2454,2460 ----
X {
X log_uerror("getsockname", NULL,"proxy: error getting socket address",
X r->server);
X! pclosef(pl, sock);
X return SERVER_ERROR;
X }
X
X***************
X*** 2462,2471 ****
X if (dsock == -1)
X {
X log_uerror("socket", NULL, "proxy: error creating socket", r->server);
X! pclosef(pool, sock);
X return SERVER_ERROR;
X }
X! note_cleanups_for_fd(pool, dsock);
X
X if (setsockopt(dsock, SOL_SOCKET, SO_REUSEADDR, (const char *)&one,
X sizeof(int)) == -1)
X--- 2462,2471 ----
X if (dsock == -1)
X {
X log_uerror("socket", NULL, "proxy: error creating socket", r->server);
X! pclosef(pl, sock);
X return SERVER_ERROR;
X }
X! note_cleanups_for_fd(pl, dsock);
X
X if (setsockopt(dsock, SOL_SOCKET, SO_REUSEADDR, (const char *)&one,
X sizeof(int)) == -1)
X***************
X*** 2472,2479 ****
X {
X log_uerror("setsockopt", NULL, "proxy: error setting reuseaddr option",
X r->server);
X! pclosef(pool, dsock);
X! pclosef(pool, sock);
X return SERVER_ERROR;
X }
X
X--- 2472,2479 ----
X {
X log_uerror("setsockopt", NULL, "proxy: error setting reuseaddr option",
X r->server);
X! pclosef(pl, dsock);
X! pclosef(pl, sock);
X return SERVER_ERROR;
X }
X
X***************
X*** 2485,2492 ****
X sprintf(buff, "%s:%d", inet_ntoa(server.sin_addr), server.sin_port);
X log_uerror("bind", buff, "proxy: error binding to ftp data socket",
X r->server);
X! pclosef(pool, sock);
X! pclosef(pool, dsock);
X }
X listen(dsock, 2); /* only need a short queue */
X
X--- 2485,2492 ----
X sprintf(buff, "%s:%d", inet_ntoa(server.sin_addr), server.sin_port);
X log_uerror("bind", buff, "proxy: error binding to ftp data socket",
X r->server);
X! pclosef(pl, sock);
X! pclosef(pl, dsock);
X }
X listen(dsock, 2); /* only need a short queue */
X
X***************
X*** 2512,2525 ****
X r->status = 200;
X r->status_line = "200 OK";
X
X! resp_hdrs = make_array(pool, 2, sizeof(struct hdr_entry));
X if (parms[0] == 'd')
X add_header(resp_hdrs, "Content-Type", "text/plain", HDR_REP);
X i = cache_update(c, resp_hdrs, "FTP", nocache);
X if (i != DECLINED)
X {
X! pclosef(pool, dsock);
X! pclosef(pool, sock);
X return i;
X }
X cache = c->fp;
X--- 2512,2525 ----
X r->status = 200;
X r->status_line = "200 OK";
X
X! resp_hdrs = make_array(pl, 2, sizeof(struct hdr_entry));
X if (parms[0] == 'd')
X add_header(resp_hdrs, "Content-Type", "text/plain", HDR_REP);
X i = cache_update(c, resp_hdrs, "FTP", nocache);
X if (i != DECLINED)
X {
X! pclosef(pl, dsock);
X! pclosef(pl, sock);
X return i;
X }
X cache = c->fp;
X***************
X*** 2533,2545 ****
X {
X log_uerror("accept", NULL, "proxy: failed to accept data connection",
X r->server);
X! pclosef(pool, dsock);
X! pclosef(pool, sock);
X cache_error(c);
X return BAD_GATEWAY;
X }
X! note_cleanups_for_fd(pool, csd);
X! data = bcreate(pool, B_RD);
X bpushfd(data, csd, -1);
X kill_timeout(r);
X
X--- 2533,2545 ----
X {
X log_uerror("accept", NULL, "proxy: failed to accept data connection",
X r->server);
X! pclosef(pl, dsock);
X! pclosef(pl, sock);
X cache_error(c);
X return BAD_GATEWAY;
X }
X! note_cleanups_for_fd(pl, csd);
X! data = bcreate(pl, B_RD);
X bpushfd(data, csd, -1);
X kill_timeout(r);
X
X***************
X*** 2597,2605 ****
X bflush(f);
X /* responses: 221, 500 */
X
X! pclosef(pool, csd);
X! pclosef(pool, dsock);
X! pclosef(pool, sock);
X
X return OK;
X }
X--- 2597,2605 ----
X bflush(f);
X /* responses: 221, 500 */
X
X! pclosef(pl, csd);
X! pclosef(pl, dsock);
X! pclosef(pl, sock);
X
X return OK;
X }
X***************
X*** 2763,2769 ****
X BUFF *f, *cache;
X struct hdr_entry *hdr;
X char buffer[HUGE_STRING_LEN], inprotocol[9], outprotocol[9];
X! pool *pool=r->pool;
X const long int zero=0L;
X
X void *sconf = r->server->module_config;
X--- 2763,2769 ----
X BUFF *f, *cache;
X struct hdr_entry *hdr;
X char buffer[HUGE_STRING_LEN], inprotocol[9], outprotocol[9];
X! pool *pl=r->pool;
X const long int zero=0L;
X
X void *sconf = r->server->module_config;
X***************
X*** 2789,2799 ****
X p = strchr(url, '/');
X if (p == NULL)
X {
X! host = pstrdup(pool, url);
X url = "/";
X } else
X {
X! char *q = palloc(pool, p-url+1);
X memcpy(q, url, p-url);
X q[p-url] = '\0';
X url = p;
X--- 2789,2799 ----
X p = strchr(url, '/');
X if (p == NULL)
X {
X! host = pstrdup(pl, url);
X url = "/";
X } else
X {
X! char *q = palloc(pl, p-url+1);
X memcpy(q, url, p-url);
X q[p-url] = '\0';
X url = p;
X***************
X*** 2817,2823 ****
X log_error("proxy: error creating socket", r->server);
X return SERVER_ERROR;
X }
X! note_cleanups_for_fd(pool, sock);
X
X i = doconnect(sock, &server, r);
X if (i == -1)
X--- 2817,2823 ----
X log_error("proxy: error creating socket", r->server);
X return SERVER_ERROR;
X }
X! note_cleanups_for_fd(pl, sock);
X
X i = doconnect(sock, &server, r);
X if (i == -1)
X***************
X*** 2826,2832 ****
X else return proxyerror(r, "Could not connect to remote machine");
X }
X
X! f = bcreate(pool, B_RDWR);
X bpushfd(f, sock, sock);
X
X hard_timeout ("proxy send", r);
X--- 2826,2832 ----
X else return proxyerror(r, "Could not connect to remote machine");
X }
X
X! f = bcreate(pl, B_RDWR);
X bpushfd(f, sock, sock);
X
X hard_timeout ("proxy send", r);
X***************
X*** 2867,2873 ****
X len = bgets(buffer, HUGE_STRING_LEN-1, f);
X if (len == -1 || len == 0)
X {
X! pclosef(pool, sock);
X return proxyerror(r, "Error reading from remote server");
X }
X
X--- 2867,2873 ----
X len = bgets(buffer, HUGE_STRING_LEN-1, f);
X if (len == -1 || len == 0)
X {
X! pclosef(pl, sock);
X return proxyerror(r, "Error reading from remote server");
X }
X
X***************
X*** 2877,2883 ****
X /* If not an HTTP/1 messsage or if the status line was > 8192 bytes */
X if (buffer[5] != '1' || buffer[len-1] != '\n')
X {
X! pclosef(pool, sock);
X return BAD_GATEWAY;
X }
X buffer[--len] = '\0';
X--- 2877,2883 ----
X /* If not an HTTP/1 messsage or if the status line was > 8192 bytes */
X if (buffer[5] != '1' || buffer[len-1] != '\n')
X {
X! pclosef(pl, sock);
X return BAD_GATEWAY;
X }
X buffer[--len] = '\0';
X***************
X*** 2889,2901 ****
X buffer[12] = '\0';
X r->status = atoi(&buffer[9]);
X buffer[12] = ' ';
X! r->status_line = pstrdup(pool, &buffer[9]);
X
X /* read the headers. */
X /* N.B. for HTTP/1.0 clients, we have to fold line-wrapped headers */
X /* Also, take care with headers with multiple occurences. */
X
X! resp_hdrs = read_headers(pool, buffer, HUGE_STRING_LEN, f);
X } else
X {
X /* an http/0.9 response */
X--- 2889,2901 ----
X buffer[12] = '\0';
X r->status = atoi(&buffer[9]);
X buffer[12] = ' ';
X! r->status_line = pstrdup(pl, &buffer[9]);
X
X /* read the headers. */
X /* N.B. for HTTP/1.0 clients, we have to fold line-wrapped headers */
X /* Also, take care with headers with multiple occurences. */
X
X! resp_hdrs = read_headers(pl, buffer, HUGE_STRING_LEN, f);
X } else
X {
X /* an http/0.9 response */
X***************
X*** 2905,2911 ****
X r->status_line = "200 OK";
X
X /* no headers */
X! resp_hdrs = make_array(pool, 2, sizeof(struct hdr_entry));
X }
X
X kill_timeout(r);
X--- 2905,2911 ----
X r->status_line = "200 OK";
X
X /* no headers */
X! resp_hdrs = make_array(pl, 2, sizeof(struct hdr_entry));
X }
X
X kill_timeout(r);
X***************
X*** 2924,2930 ****
X if (strcasecmp(p, "Date") == 0 ||
X strcasecmp(p, "Last-Modified") == 0 ||
X strcasecmp(p, "Expires") == 0)
X! hdr[i].value = date_canon(pool, hdr[i].value);
X }
X
X /* check if NoCache directive on this host */
X--- 2924,2930 ----
X if (strcasecmp(p, "Date") == 0 ||
X strcasecmp(p, "Last-Modified") == 0 ||
X strcasecmp(p, "Expires") == 0)
X! hdr[i].value = date_canon(pl, hdr[i].value);
X }
X
X /* check if NoCache directive on this host */
X***************
X*** 2937,2943 ****
X i = cache_update(c, resp_hdrs, inprotocol, nocache);
X if (i != DECLINED)
X {
X! pclosef(pool, sock);
X return i;
X }
X
X--- 2937,2943 ----
X i = cache_update(c, resp_hdrs, inprotocol, nocache);
X if (i != DECLINED)
X {
X! pclosef(pl, sock);
X return i;
X }
X
X***************
X*** 2988,2994 ****
X
X cache_tidy(c);
X
X! pclosef(pool, sock);
X
X return OK;
X }
X--- 2988,2994 ----
X
X cache_tidy(c);
X
X! pclosef(pl, sock);
X
X return OK;
X }
XIndex: misc/apache/src/mod_status.c
Xdiff -c misc/apache/src/mod_status.c:1.1.1.1 misc/apache/src/mod_status.c:1.2
X*** misc/apache/src/mod_status.c:1.1.1.1 Wed Jun 19 13:45:04 1996
X--- misc/apache/src/mod_status.c Fri Jun 21 18:28:58 1996
X***************
X*** 163,169 ****
X
X int status_handler (request_rec *r)
X {
X! struct stat_opt options[] = /* see #defines above */
X {
X { STAT_OPT_REFRESH, "refresh", "Refresh" },
X { STAT_OPT_NOTABLE, "notable", NULL },
X--- 163,169 ----
X
X int status_handler (request_rec *r)
X {
X! static struct stat_opt options[] = /* see #defines above */
X {
X { STAT_OPT_REFRESH, "refresh", "Refresh" },
X { STAT_OPT_NOTABLE, "notable", NULL },
X***************
X*** 188,194 ****
X int no_table_report=0;
X server_rec *server = r->server;
X short_score score_record;
X! char status[]="??????????";
X char stat_buffer[HARD_SERVER_LIMIT];
X clock_t tu,ts,tcu,tcs;
X
X--- 188,194 ----
X int no_table_report=0;
X server_rec *server = r->server;
X short_score score_record;
X! char *status="??????????";
X char stat_buffer[HARD_SERVER_LIMIT];
X clock_t tu,ts,tcu,tcs;
X
END_OF_FILE
if test 49774 -ne `wc -c <'apache-1.1b4-v0.diffs'`; then
echo shar: \"'apache-1.1b4-v0.diffs'\" unpacked with wrong size!
fi
# end of 'apache-1.1b4-v0.diffs'
fi
echo shar: End of shell archive.
exit 0
--
Greg A. Woods
+1 416 443-1734 VE3TCP robohack!woods
Planix, Inc. <wo...@planix.com>; Secrets of the Weird <wo...@weird.com>
----- End of forwarded message from Greg A. Woods -----