cvs commit: apachen/src/main conf.h http_main.c
dgaudet 98/01/21 16:00:00 Modified:src CHANGES Configure src/main conf.h http_main.c Log: Found a great cleanup patch for unixware in PR#1282. Applied it with slight modifications. This should cleanup SIGHUP, serialized accept problems, and enable syslog support. PR: 1082, 1282, 1499, 1553 Submitted by: Tom Hughes [EMAIL PROTECTED] Revision ChangesPath 1.588 +5 -2 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.587 retrieving revision 1.588 diff -u -r1.587 -r1.588 --- CHANGES 1998/01/21 23:49:02 1.587 +++ CHANGES 1998/01/21 23:59:52 1.588 @@ -1,7 +1,10 @@ Changes with Apache 1.3b4 - *) PORT: UnixWare 2.1.2 SMP appears to require USE_FCNTL_SERIALIZED_ACCEPT. - It should be safe on all versions. [Dean Gaudet] PR#1553 + *) PORT: UnixWare 2.1.2 SMP appears to require USE_FCNTL_SERIALIZED_ACCEPT, + as do various earlier versions. It should be safe on all versions. + Unixware 1.x appears to have the same SIGHUP bug as solaris does with + the slack code. A few other cleanups for Unixware. + [Tom Hughes [EMAIL PROTECTED]] PR#1082, PR#1282, PR#1499, PR#1553 *) PORT: A/UX can handle single-listen accepts without mutex locking, so we add SAFE_UNSERIALIZED_ACCEPT. [Jim Jagielski] 1.178 +4 -4 apachen/src/Configure Index: Configure === RCS file: /export/home/cvs/apachen/src/Configure,v retrieving revision 1.177 retrieving revision 1.178 diff -u -r1.177 -r1.178 --- Configure 1998/01/21 17:12:34 1.177 +++ Configure 1998/01/21 23:59:54 1.178 @@ -428,23 +428,23 @@ *-unixware1) DEF_WANTHSREGEX=yes OS='Unixware' - CFLAGS=$CFLAGS -DSVR4 -DNO_LINGCLOSE + CFLAGS=$CFLAGS -DUW=100 LIBS=$LIBS -lsocket -lnsl -lcrypt ;; *-unixware2) DEF_WANTHSREGEX=yes OS='Unixware' - CFLAGS=$CFLAGS -DSVR4 -DNO_LINGCLOSE + CFLAGS=$CFLAGS -DUW=200 LIBS=$LIBS -lsocket -lnsl -lcrypt -lgen ;; *-unixware211) OS='Unixware 2.1.1' - CFLAGS=$CFLAGS -DUW + CFLAGS=$CFLAGS -DUW=211 LIBS=$LIBS -lsocket -lnsl -lcrypt -lgen ;; *-unixware212) OS='Unixware 2.1.2' - CFLAGS=$CFLAGS -DUW + CFLAGS=$CFLAGS -DUW=212 LIBS=$LIBS -lsocket -lnsl -lcrypt -lgen DBM_LIB= ;; 1.173 +2 -0 apachen/src/main/conf.h Index: conf.h === RCS file: /export/home/cvs/apachen/src/main/conf.h,v retrieving revision 1.172 retrieving revision 1.173 diff -u -r1.172 -r1.173 --- conf.h1998/01/21 23:49:06 1.172 +++ conf.h1998/01/21 23:59:56 1.173 @@ -472,7 +472,9 @@ #define HAVE_SYS_SELECT_H #define HAVE_SYS_RESOURCE_H #include sys/time.h +#if UW = 200 #define _POSIX_SOURCE +#endif #define NET_SIZE_T size_t #define HAVE_SYSLOG #define USE_FCNTL_SERIALIZED_ACCEPT 1.271 +5 -0 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.270 retrieving revision 1.271 diff -u -r1.270 -r1.271 --- http_main.c 1998/01/21 22:24:04 1.270 +++ http_main.c 1998/01/21 23:59:58 1.271 @@ -2499,6 +2499,11 @@ #define WORKAROUND_SOLARIS_BUG #endif +/* PR#1282 Unixware 1.x appears to have the same problem as solaris */ +#if defined (UW) UW 200 +#define WORKAROUND_SOLARIS_BUG +#endif + #ifndef WORKAROUND_SOLARIS_BUG s = ap_slack(s, AP_SLACK_HIGH);
cvs commit: apachen/src/main conf.h http_main.c
dgaudet 97/11/06 02:47:03 Modified:src CHANGES src/main conf.h http_main.c Log: Papa Roy said I could commit this. Fix USE_PTHREAD_SERIALIZED_ACCEPT, I totally didn't do it right the first time. Reviewed by: Roy Fielding Revision ChangesPath 1.488 +3 -6 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.487 retrieving revision 1.488 diff -u -r1.487 -r1.488 --- CHANGES 1997/11/06 03:03:08 1.487 +++ CHANGES 1997/11/06 10:46:58 1.488 @@ -1,10 +1,7 @@ Changes with Apache 1.3b3 - - *) Restored USE_FCNTL_SERIALIZED_ACCEPT as the default for Solaris2, - since the PTHREAD mechanism was losing locks on Solaris 2.5.0. - You can now set -DUSE_SYSVSEM_SERIALIZED_ACCEPT or - -DUSE_PTHREAD_SERIALIZED_ACCEPT in Configuration if you want to - test the other two methods. [Roy Fielding] + + *) Solaris = 2.5 was totally broken due to a mess up using pthread + mutexes. [Roy Fielding, Dean Gaudet] *) OS/2 Port updated; it should be possible to build OS/2 from the same sources as Unix now. [Brian Havard [EMAIL PROTECTED]] 1.153 +2 -2 apachen/src/main/conf.h Index: conf.h === RCS file: /export/home/cvs/apachen/src/main/conf.h,v retrieving revision 1.152 retrieving revision 1.153 diff -u -r1.152 -r1.153 --- conf.h1997/11/06 02:57:23 1.152 +++ conf.h1997/11/06 10:47:00 1.153 @@ -125,8 +125,8 @@ #define HAVE_SYS_RESOURCE_H #define bzero(a,b) memset(a,0,b) #if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) \ -!defined(USE_PTHREAD_SERIALIZED_ACCEPT) -#define USE_FCNTL_SERIALIZED_ACCEPT +!defined(USE_FCNTL_SERIALIZED_ACCEPT) +#define USE_PTHREAD_SERIALIZED_ACCEPT #endif #define NEED_UNION_SEMUN #define HAVE_MMAP 1.245 +47 -3 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.244 retrieving revision 1.245 diff -u -r1.244 -r1.245 --- http_main.c 1997/11/05 12:48:17 1.244 +++ http_main.c 1997/11/06 10:47:01 1.245 @@ -333,18 +333,33 @@ #elif defined (USE_PTHREAD_SERIALIZED_ACCEPT) /* This code probably only works on Solaris ... but it works really fast - * on Solaris + * on Solaris. Note that pthread mutexes are *NOT* released when a task + * dies ... the task has to free it itself. So we block signals and + * try to be nice about releasing the mutex. */ #include pthread.h -static pthread_mutex_t *accept_mutex; +static pthread_mutex_t *accept_mutex = (void *)(caddr_t) -1; +static int have_accept_mutex; +static sigset_t accept_block_mask; +static sigset_t accept_previous_mask; + +static void accept_mutex_child_cleanup(void *data) +{ +if (accept_mutex != (void *)(caddr_t)-1 + have_accept_mutex) { + pthread_mutex_unlock(accept_mutex); +} +} static void accept_mutex_cleanup(void) { -if (munmap((caddr_t) accept_mutex, sizeof(*accept_mutex))) { +if (accept_mutex != (void *)(caddr_t)-1 + munmap((caddr_t) accept_mutex, sizeof(*accept_mutex))) { perror(munmap); } +accept_mutex = (void *)(caddr_t)-1; } static void accept_mutex_init(pool *p) @@ -376,14 +391,25 @@ perror(pthread_mutex_init); exit(1); } +sigfillset(accept_block_mask); +sigdelset(accept_block_mask, SIGHUP); +sigdelset(accept_block_mask, SIGTERM); +sigdelset(accept_block_mask, SIGUSR1); +register_cleanup(pconf, NULL, accept_mutex_child_cleanup, + accept_mutex_child_cleanup); } static void accept_mutex_on() { +if (sigprocmask(SIG_BLOCK, accept_block_mask, accept_previous_mask)) { + perror(sigprocmask(SIG_BLOCK)); + exit (1); +} if (pthread_mutex_lock(accept_mutex)) { perror(pthread_mutex_lock); exit(1); } +have_accept_mutex = 1; } static void accept_mutex_off() @@ -391,6 +417,24 @@ if (pthread_mutex_unlock(accept_mutex)) { perror(pthread_mutex_unlock); exit(1); +} +/* There is a slight race condition right here... if we were to die right + * now, we'd do another pthread_mutex_unlock. Now, doing that would let + * another process into the mutex. pthread mutexes are designed to be + * fast, as such they don't have protection for things like testing if the + * thread owning a mutex is actually unlocking it (or even any way of + * testing who owns the mutex). + * + * If we were to unset have_accept_mutex
cvs commit: apachen/src/main conf.h http_main.c
dgaudet 97/10/01 22:25:05 Modified:src CHANGES Configure src/helpers GuessOS src/main conf.h http_main.c Log: Atari MINT port. Submitted by: Jan Paul Schmidt [EMAIL PROTECTED] Reviewed by: Dean Gaudet, Brian Behlendorf, Jim Jagielski Revision ChangesPath 1.455 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.454 retrieving revision 1.455 diff -u -r1.454 -r1.455 --- CHANGES 1997/10/02 05:10:30 1.454 +++ CHANGES 1997/10/02 05:24:53 1.455 @@ -1,5 +1,8 @@ Changes with Apache 1.3b1 + *) PORT: Support for Atari MINT. + [Jan Paul Schmidt [EMAIL PROTECTED]] + *) When booting, apache will now detach itself from stdin, stdout, and stderr. stderr will not be detached until after the config files have been read so you will be able to see initial error 1.158 +6 -0 apachen/src/Configure Index: Configure === RCS file: /export/home/cvs/apachen/src/Configure,v retrieving revision 1.157 retrieving revision 1.158 diff -u -r1.157 -r1.158 --- Configure 1997/09/26 03:05:23 1.157 +++ Configure 1997/10/02 05:24:55 1.158 @@ -163,6 +163,12 @@ OSDIR=os/unix case $PLAT in +*mint) +OS=MiNT +CFLAGS=-DMINT +LIBS=$LIBS -lportlib -lsocket +DEF_WANTHSREGEX=yes +;; *MPE/iX*) OS='MPE/iX' CFLAGS=$CFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE 1.31 +3 -0 apachen/src/helpers/GuessOS Index: GuessOS === RCS file: /export/home/cvs/apachen/src/helpers/GuessOS,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- GuessOS 1997/09/16 03:59:59 1.30 +++ GuessOS 1997/10/02 05:24:58 1.31 @@ -56,6 +56,9 @@ # Now we simply scan though... In most cases, the SYSTEM info is enough # case ${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE} in +MiNT:*) +echo m68k-atari-mint; exit 0 + ;; A/UX:*) echo m68k-apple-aux3; exit 0 ;; 1.143 +13 -1 apachen/src/main/conf.h Index: conf.h === RCS file: /export/home/cvs/apachen/src/main/conf.h,v retrieving revision 1.142 retrieving revision 1.143 diff -u -r1.142 -r1.143 --- conf.h1997/09/25 01:03:20 1.142 +++ conf.h1997/10/02 05:25:00 1.143 @@ -67,7 +67,19 @@ #endif /* Define one of these according to your system. */ -#if defined(MPE) +#if defined(MINT) +typedef int rlim_t; +#define HAVE_SYS_RESOURCE_H +#define JMP_BUF sigjmp_buf +#define NO_LONG_DOUBLE +#define USE_FLOCK_SERIALIZED_ACCEPT +#define _BSD_SOURCE +#define EAGAIN EACCESS +int initgroups (char *, int); +char *crypt (const char *pw, const char *salt); +int gethostname (char *name, int namelen); + +#elif defined(MPE) #include sys/times.h #define NO_SETSID #define NO_KILLPG 1.228 +5 -5 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.227 retrieving revision 1.228 diff -u -r1.227 -r1.228 --- http_main.c 1997/10/02 05:10:33 1.227 +++ http_main.c 1997/10/02 05:25:03 1.228 @@ -117,6 +117,10 @@ #endif +#ifdef MINT +long _stksize = 32768; +#endif + #ifdef __EMX__ /* Add MMAP style functionality to OS/2 */ #ifdef HAVE_MMAP @@ -3808,11 +3812,7 @@ int csd, int dupped_csd, int requests_this_child, pool *pchild) { -#if defined(UW) -size_t clen; -#else -int clen; -#endif +NET_SIZE_T clen; struct sockaddr sa_server; struct sockaddr sa_client;