Re: cvs commit: apache-2.0/src/os/unix iol_socket.c unixd.c
[EMAIL PROTECTED] wrote: > > rbb 00/01/28 10:02:32 > > Modified:src/ap ap_hooks.c ap_sha1.c >src/helpers build-modules-c.awk >src/main buff.c gen_test_char.c http_config.c > http_connection.c http_core.c http_main.c > http_protocol.c http_request.c http_vhost.c > iol_file.c listen.c rfc1413.c util.c util_md5.c > util_script.c util_uri.c >src/modules/mpm/prefork prefork.c >src/modules/standard mod_actions.c mod_alias.c mod_asis.c > mod_auth.c mod_dir.c mod_echo.c mod_setenvif.c >src/os/unix iol_socket.c unixd.c > Log: > Include ap_config.h before httpd.h, this ensures that AP_USE_HSREGEX is > defined correctly in all C files. If its a requirement, shouldn't httpd.h include ap_config.h, rather then requiring module authors to magically know they should do this? Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html Y19100 no-prize winner! http://www.ntk.net/index.cgi?back=2000/now0121.txt
Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h
[EMAIL PROTECTED] wrote: > > > > -#ifdef HAVE_STRUCT_UNION_SEMUN > > > -#include > > > -#endif > > > > > >#if APR_HAS_THREADS > > >#if HAVE_PTHREAD_H > > > @@ -99,7 +96,7 @@ > > >#endif > > >/* End System Headers */ > > > > > > -#ifndef HAVE_STRUCT_UNION_SEMUN > > > +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE > > >/* it makes no sense, but this isn't defined on solaris */ > > >union semun { > > >long val; > > > > Que? If you don't include sys/sem.h, then this doesn't compile - why did > > you remove it? > > If you look about four lines above this,. we include sys/sem.h if it is on > the system. The problem was we weren't checking for it. I put the check > into configure.in, so we should be including it. I just didn't see a need > for sys/sem.h to be included twice. :-) Aha! :-) In which case, it'd make sense to use HAVE_SYS_SEM_H for the other one, too. > > BTW, why are these structures included in the locking structure at all? > > They're essentially constant static structures, but they currently exist > > in each lock. > > > > I have no good answer for this. I'll look into it though. :-) Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html Y19100 no-prize winner! http://www.ntk.net/index.cgi?back=2000/now0121.txt
Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h
[EMAIL PROTECTED] wrote: > 1.10 +1 -4 apache-2.0/src/lib/apr/locks/unix/locks.h > > Index: locks.h > === > RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.h,v > retrieving revision 1.9 > retrieving revision 1.10 > diff -u -r1.9 -r1.10 > --- locks.h 2000/01/23 01:13:47 1.9 > +++ locks.h 2000/01/24 13:59:02 1.10 > @@ -88,9 +88,6 @@ >#if HAVE_FCNTL_H >#include >#endif > -#ifdef HAVE_STRUCT_UNION_SEMUN > -#include > -#endif > >#if APR_HAS_THREADS >#if HAVE_PTHREAD_H > @@ -99,7 +96,7 @@ >#endif >/* End System Headers */ > > -#ifndef HAVE_STRUCT_UNION_SEMUN > +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE >/* it makes no sense, but this isn't defined on solaris */ >union semun { >long val; Que? If you don't include sys/sem.h, then this doesn't compile - why did you remove it? BTW, why are these structures included in the locking structure at all? They're essentially constant static structures, but they currently exist in each lock. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html Y19100 no-prize winner! http://www.ntk.net/index.cgi?back=2000/now0121.txt
Re: cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
[EMAIL PROTECTED] wrote: > > >src/lib/apr/include apr_portable.h > >src/lib/apr/locks/unix crossproc.c locks.h > >src/lib/apr/time/unix timestr.c > > Log: > > Make interprocess mutexes actually choose, fix semaphore mutexes. > > What does this mean? It means don't force them to be always fcntl, i.e. actually use the choice instead of overriding it. > > > Index: apr_portable.h > > === > > RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v > > retrieving revision 1.18 > > retrieving revision 1.19 > > diff -u -r1.18 -r1.19 > > --- apr_portable.h 2000/01/09 20:58:22 1.18 > > +++ apr_portable.h 2000/01/23 01:13:45 1.19 > > @@ -81,6 +81,9 @@ > >#if APR_HAVE_PTHREAD_H > >#include > >#endif > > +#ifdef HAVE_STRUCT_UNION_SEMUN > > +#include > > +#endif > > This is bad. We cannot use HAVE_ macros in public header files, because > they aren't namepsace protected. It really doesn't matter if we named > them ourselves or if autoconf named them for us. Please change this to > APR_HAVE_STRUCT_UNION_SEMUN. Sure, but I couldn't figure out where/how that happens/should happen. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html Y19100 no-prize winner! http://www.ntk.net/index.cgi?back=2000/now0121.txt
cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
ben 00/01/22 17:13:48 Modified:src/lib/apr configure.in src/lib/apr/include apr_portable.h src/lib/apr/locks/unix crossproc.c locks.h src/lib/apr/time/unix timestr.c Log: Make interprocess mutexes actually choose, fix semaphore mutexes. Revision ChangesPath 1.46 +37 -38apache-2.0/src/lib/apr/configure.in Index: configure.in === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- configure.in 2000/01/19 01:14:49 1.45 +++ configure.in 2000/01/23 01:13:44 1.46 @@ -161,43 +161,6 @@ AC_CHECK_DEFINE(LOCK_EX, sys/file.h) AC_CHECK_DEFINE(F_SETLK, fcntl.h) -dnl Checks for libraries. -AC_BEGIN_DECISION([lock implementation method]) -AC_IFALLYES(header:sys/file.h define:LOCK_EX, -AC_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) -AC_IFALLYES(header:sys/ipc.h header:sys/sem.h header:sys/file.h dnl -func:semget func:semctl, -AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) -AC_IFALLYES(header:fcntl.h define:F_SETLK, -AC_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) -AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl -custom:use_pthread_cross, -AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) -AC_DECISION_FORCE(USE_FCNTL_SERIALIZE) -AC_END_DECISION -AC_DEFINE_UNQUOTED($ac_decision) - -if test ".$ac_decision" = ".USE_FLOCK_SERIALIZE"; then -flockser="1" -else -flockser="0" -fi -if test ".$ac_decision" = ".USE_SYSVSEM_SERIALIZE"; then -sysvser="1" -else -sysvser="0" -fi -if test ".$ac_decision" = ".USE_FCNTL_SERIALIZE"; then -fcntlser="1" -else -fcntlser="0" -fi -if test ".$ac_decision" = ".USE_PROC_PTHREAD_SERIALIZE"; then -procpthreadser="1" -else -procpthreadser="0" -fi - ac_cv_define_READDIR_IS_THREAD_SAFE=no AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) @@ -322,7 +285,7 @@ ],[ union semun arg; semctl(0, 0, 0, arg); -], AC_DEFINE(HAVE_STRUCT_UNION_SEMUN) +], [AC_DEFINE(HAVE_STRUCT_UNION_SEMUN) union_semun=yes] msg=yes,dnl msg=no) AC_MSG_RESULT([$msg]) @@ -352,6 +315,42 @@ AC_SUBST(inet_network) AC_CHECK_FUNCS(gmtime_r localtime_r) + +dnl Checks for libraries. +AC_BEGIN_DECISION([lock implementation method]) +AC_IFALLYES(header:sys/file.h define:LOCK_EX, +AC_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) +AC_IFALLYES(header:fcntl.h define:F_SETLK, +AC_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) +AC_IFALLYES(custom:union_semun, +AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) +AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl +custom:use_pthread_cross, +AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) +dnl AC_DECISION_FORCE(USE_FCNTL_SERIALIZE) +AC_END_DECISION +AC_DEFINE_UNQUOTED($ac_decision) + +if test ".$ac_decision" = ".USE_FLOCK_SERIALIZE"; then +flockser="1" +else +flockser="0" +fi +if test ".$ac_decision" = ".USE_SYSVSEM_SERIALIZE"; then +sysvser="1" +else +sysvser="0" +fi +if test ".$ac_decision" = ".USE_FCNTL_SERIALIZE"; then +fcntlser="1" +else +fcntlser="0" +fi +if test ".$ac_decision" = ".USE_PROC_PTHREAD_SERIALIZE"; then +procpthreadser="1" +else +procpthreadser="0" +fi dnl Start building stuff from our information AC_SUBST(LDLIBS) 1.19 +3 -0 apache-2.0/src/lib/apr/include/apr_portable.h Index: apr_portable.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- apr_portable.h2000/01/09 20:58:22 1.18 +++ apr_portable.h2000/01/23 01:13:45 1.19 @@ -81,6 +81,9 @@ #if APR_HAVE_PTHREAD_H #include #endif +#ifdef HAVE_STRUCT_UNION_SEMUN +#include +#endif #ifdef WIN32 /* The primitives for Windows types */ 1.11 +7 -5 apache-2.0/src/lib/apr/locks/unix/crossproc.c Index: crossproc.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/locks/unix/crossproc.c,v retrieving revision 1.10 retri
Re: cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
[EMAIL PROTECTED] wrote: > > stoddard00/01/17 15:23:48 > > Modified:src/lib/apr/time/unix timestr.c > Log: > Initialize struct tm > Submitted by: Paul Reder > > +memset(&tm, 0, sizeof(struct tm)); Y'know, memset(&tm, 0, sizeof tm); has always struck me as more correct and less prone to coming back and biting you later... Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/build buildcheck.sh
ben 00/01/15 07:37:53 Modified:src/build buildcheck.sh Log: We're building Apache, not PHP. Revision ChangesPath 1.2 +6 -6 apache-2.0/src/build/buildcheck.sh Index: buildcheck.sh === RCS file: /export/home/cvs/apache-2.0/src/build/buildcheck.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- buildcheck.sh 2000/01/11 13:10:58 1.1 +++ buildcheck.sh 2000/01/15 15:37:52 1.2 @@ -7,14 +7,14 @@ if test -z "$ac_version"; then echo "buildconf: autoconf not found." echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." +echo " to build Apache from CVS." exit 1 fi IFS=.; set $ac_version; IFS=' ' if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." +echo " to build Apache from CVS." exit 1 else echo "buildconf: autoconf version $ac_version (ok)" @@ -25,14 +25,14 @@ if test "$am_version" = ""; then echo "buildconf: automake not found." echo " You need automake version 1.4 or newer installed" -echo " to build PHP from CVS." +echo " to build Apache from CVS." exit 1 fi IFS=.; set $am_version; IFS=' ' if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then echo "buildconf: automake version $am_version found." echo " You need automake version 1.4 or newer installed" -echo " to build PHP from CVS." +echo " to build Apache from CVS." exit 1 else echo "buildconf: automake version $am_version (ok)" @@ -43,7 +43,7 @@ if test "$lt_pversion" = ""; then echo "buildconf: libtool not found." echo " You need libtool version 1.3 or newer installed" -echo " to build PHP from CVS." +echo " to build Apache from CVS." exit 1 fi lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` @@ -54,7 +54,7 @@ else echo "buildconf: libtool version $lt_pversion found." echo " You need libtool version 1.3.3 or newer installed" -echo " to build PHP from CVS." +echo " to build Apache from CVS." exit 1 fi
cvs commit: apache-1.3/src/modules/standard mod_actions.c
ben 00/01/11 06:23:04 Modified:src CHANGES src/modules/standard mod_actions.c Log: Make Action work when Location doesn't exist. Submitted by: Manoj Reviewed by: Ben Revision ChangesPath 1.1492+4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1491 retrieving revision 1.1492 diff -u -r1.1491 -r1.1492 --- CHANGES 2000/01/11 14:13:37 1.1491 +++ CHANGES 2000/01/11 14:22:59 1.1492 @@ -1,5 +1,9 @@ Changes with Apache 1.3.10 + *) An Action set for a Location that didn't correspond to a file didn't + work. Fixed. + [Manoj Kasichainula, Ben Laurie] + *) ProxyPass erroneously converted authentication requests to proxy authentication requests. Fixed. [Ben Laurie] 1.33 +0 -5 apache-1.3/src/modules/standard/mod_actions.c Index: mod_actions.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_actions.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- mod_actions.c 1999/12/08 19:01:48 1.32 +++ mod_actions.c 2000/01/11 14:23:03 1.33 @@ -245,11 +245,6 @@ if ((t = ap_table_get(conf->action_types, action ? action : ap_default_type(r { script = t; - if (r->finfo.st_mode == 0) { - ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, - "File does not exist: %s", r->filename); - return NOT_FOUND; - } } if (script == NULL) {
cvs commit: apache-1.3/src/modules/standard mod_mime.c
ben 00/01/11 06:13:50 Modified:src CHANGES src/include httpd.h src/main http_core.c http_protocol.c http_request.c src/modules/proxy mod_proxy.c mod_proxy.h proxy_ftp.c proxy_http.c proxy_util.c src/modules/standard mod_mime.c Log: Don't convert auth to proxy auth when it shouldn't be. Revision ChangesPath 1.1491+4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1490 retrieving revision 1.1491 diff -u -r1.1490 -r1.1491 --- CHANGES 2000/01/10 21:33:06 1.1490 +++ CHANGES 2000/01/11 14:13:37 1.1491 @@ -1,5 +1,9 @@ Changes with Apache 1.3.10 + *) ProxyPass erroneously converted authentication requests to proxy + authentication requests. Fixed. + [Ben Laurie] + *) Reverse a patch which broke HPUX shared builds. Basically we comment out the SHLIB_SUFFIX_NAME=sl line in Configure. [Ryan Bloom] 1.298 +7 -1 apache-1.3/src/include/httpd.h Index: httpd.h === RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.297 retrieving revision 1.298 diff -u -r1.297 -r1.298 --- httpd.h 1999/12/09 12:05:02 1.297 +++ httpd.h 2000/01/11 14:13:39 1.298 @@ -658,6 +658,12 @@ #include "util_uri.h" +enum proxyreqtype { +NOT_PROXY=0, +STD_PROXY, +PROXY_PASS +}; + struct request_rec { ap_pool *pool; @@ -681,7 +687,7 @@ char *the_request; /* First line of request, so we can log it */ int assbackwards;/* HTTP/0.9, "simple" request */ -int proxyreq;/* A proxy request (calculated during +enum proxyreqtype proxyreq;/* A proxy request (calculated during * post_read_request or translate_name) */ int header_only; /* HEAD request, as opposed to GET */ char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ 1.277 +1 -1 apache-1.3/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.276 retrieving revision 1.277 diff -u -r1.276 -r1.277 --- http_core.c 1999/12/21 07:52:55 1.276 +++ http_core.c 2000/01/11 14:13:40 1.277 @@ -2956,7 +2956,7 @@ void *sconf = r->server->module_config; core_server_config *conf = ap_get_module_config(sconf, &core_module); -if (r->proxyreq) { +if (r->proxyreq != NOT_PROXY) { return HTTP_FORBIDDEN; } if ((r->uri[0] != '/') && strcmp(r->uri, "*")) { 1.286 +8 -5 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.285 retrieving revision 1.286 diff -u -r1.285 -r1.286 --- http_protocol.c 2000/01/04 10:20:39 1.285 +++ http_protocol.c 2000/01/11 14:13:41 1.286 @@ -1162,7 +1162,8 @@ ap_note_auth_failure(r); else ap_table_setn(r->err_headers_out, - r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", + r->proxyreq == STD_PROXY ? "Proxy-Authenticate" + : "WWW-Authenticate", ap_pstrcat(r->pool, "Basic realm=\"", ap_auth_name(r), "\"", NULL)); } @@ -1170,7 +1171,8 @@ API_EXPORT(void) ap_note_digest_auth_failure(request_rec *r) { ap_table_setn(r->err_headers_out, - r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", + r->proxyreq == STD_PROXY ? "Proxy-Authenticate" + : "WWW-Authenticate", ap_psprintf(r->pool, "Digest realm=\"%s\", nonce=\"%lu\"", ap_auth_name(r), r->request_time)); } @@ -1178,8 +1180,9 @@ API_EXPORT(int) ap_get_basic_auth_pw(request_rec *r, const char **pw) { const char *auth_line = ap_table_get(r->headers_in, - r->proxyreq ? "Proxy-Authorization" - : "Authorization"); + r->proxyreq == STD_PROXY + ? "Proxy-A
Re: cvs commit: apache-2.0/src/modules/standard mod_digest.c mod_vhost_alias.c
[EMAIL PROTECTED] wrote: > > rbb 99/12/31 09:06:16 > > Modified:src/modules/standard mod_digest.c mod_vhost_alias.c > Log: > Update these modules to Apache 2.0. Not tested, but they compile again. On that note ... how do you actually get a module into Apache 2.0? I tried to add mod_actions earlier today (./configure --enable-actions) but it didn't seem to result in a server that understood Action. Not sure I'm keen on that method of doing it, anyway. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/lib/apr/lib apr_md5.c
ben 99/12/30 14:18:24 Modified:src/lib/apr/lib apr_md5.c Log: Fix warning. Revision ChangesPath 1.7 +3 -0 apache-2.0/src/lib/apr/lib/apr_md5.c Index: apr_md5.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/lib/apr_md5.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- apr_md5.c 1999/12/19 18:10:01 1.6 +++ apr_md5.c 1999/12/30 22:18:19 1.7 @@ -110,6 +110,9 @@ #ifdef HAVE_CRYPT_H #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif /* Constants for MD5Transform routine. */
Re: cvs commit: apache-2.0/src/lib/apr Makefile.in
Sascha Schumann wrote: > > On Wed, Dec 22, 1999 at 06:27:18PM +0000, Ben Laurie wrote: > > Sascha Schumann wrote: > > > > > > On Wed, Dec 22, 1999 at 05:52:05PM +, Ben Laurie wrote: > > > > Ryan Bloom wrote: > > > > > > > > > > On Wed, 22 Dec 1999, Ben Laurie wrote: > > > > > > > > > > > [EMAIL PROTECTED] wrote: > > > > > > > > > > > > > > ben 99/12/22 03:46:36 > > > > > > > > > > > > > > Modified:src/lib/apr Makefile.in > > > > > > > Log: > > > > > > > We now link on FreeBSD 2.2.x. > > > > > > > > > > > > But somewhere recently we've started to require GNU make. > > > > > > > > > > When did that happen? Is it APR or Apache that is requiring GNU make? > > > > > > > > Diagnosed: its the include stuff. You can't say: > > > > > > > > -include $(DEP_FILES) > > > > > > > > in BSD make. You have to include them individually with .include and > > > > quotemarks... > > > > > > > > Does that work with GNU make? > > > > > > > > > > include filename > > > > > > is the portable version. Works with GNU, BSD, SysV make. > > > > Marvellous. In that case it is automake that is broken. I'm running > > v1.4. > > make clean? Yes, that's broken :( Eh? What I mean is that it is automake that is generation the -include directive that does not work with BSD make. So, I can't fix it unless we can fix automake. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
Re: cvs commit: apache-2.0/src/lib/apr Makefile.in
Sascha Schumann wrote: > > On Wed, Dec 22, 1999 at 05:52:05PM +0000, Ben Laurie wrote: > > Ryan Bloom wrote: > > > > > > On Wed, 22 Dec 1999, Ben Laurie wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > > > > > > > > ben 99/12/22 03:46:36 > > > > > > > > > > Modified:src/lib/apr Makefile.in > > > > > Log: > > > > > We now link on FreeBSD 2.2.x. > > > > > > > > But somewhere recently we've started to require GNU make. > > > > > > When did that happen? Is it APR or Apache that is requiring GNU make? > > > > Diagnosed: its the include stuff. You can't say: > > > > -include $(DEP_FILES) > > > > in BSD make. You have to include them individually with .include and > > quotemarks... > > > > Does that work with GNU make? > > > > include filename > > is the portable version. Works with GNU, BSD, SysV make. Marvellous. In that case it is automake that is broken. I'm running v1.4. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
Re: cvs commit: apache-2.0/src/lib/apr Makefile.in
Sascha Schumann wrote: > > On Wed, Dec 22, 1999 at 05:52:05PM +0000, Ben Laurie wrote: > > Ryan Bloom wrote: > > > > > > On Wed, 22 Dec 1999, Ben Laurie wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > > > > > > > > ben 99/12/22 03:46:36 > > > > > > > > > > Modified:src/lib/apr Makefile.in > > > > > Log: > > > > > We now link on FreeBSD 2.2.x. > > > > > > > > But somewhere recently we've started to require GNU make. > > > > > > When did that happen? Is it APR or Apache that is requiring GNU make? > > > > Diagnosed: its the include stuff. You can't say: > > > > -include $(DEP_FILES) > > > > in BSD make. You have to include them individually with .include and > > quotemarks... > > > > Does that work with GNU make? > > > > include filename > > is the portable version. Works with GNU, BSD, SysV make. Aha. Thanks. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
Re: cvs commit: apache-2.0/src/lib/apr Makefile.in
Ryan Bloom wrote: > > On Wed, 22 Dec 1999, Ben Laurie wrote: > > > [EMAIL PROTECTED] wrote: > > > > > > ben 99/12/22 03:46:36 > > > > > > Modified:src/lib/apr Makefile.in > > > Log: > > > We now link on FreeBSD 2.2.x. > > > > But somewhere recently we've started to require GNU make. > > When did that happen? Is it APR or Apache that is requiring GNU make? Diagnosed: its the include stuff. You can't say: -include $(DEP_FILES) in BSD make. You have to include them individually with .include and quotemarks... Does that work with GNU make? Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
Re: cvs commit: apache-2.0/src/lib/apr Makefile.in
[EMAIL PROTECTED] wrote: > > ben 99/12/22 03:46:36 > > Modified:src/lib/apr Makefile.in > Log: > We now link on FreeBSD 2.2.x. But somewhere recently we've started to require GNU make. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/lib/apr Makefile.in
ben 99/12/22 03:46:36 Modified:src/lib/apr Makefile.in Log: We now link on FreeBSD 2.2.x. Revision ChangesPath 1.15 +1 -0 apache-2.0/src/lib/apr/Makefile.in Index: Makefile.in === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/Makefile.in,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Makefile.in 1999/12/21 22:05:04 1.14 +++ Makefile.in 1999/12/22 11:46:35 1.15 @@ -44,6 +44,7 @@ @rm -f @[EMAIL PROTECTED] for i in $(SUBDIRS); do cp $$i/*.o objs ; done; $(AR) cr @[EMAIL PROTECTED] objs/*.o + $(RANLIB) @[EMAIL PROTECTED] clean: subdirs_clean $(RM) -f *.o *.a *.so objs/*.o
Re: cvs commit: apache-2.0/src buildconf configure.in
Ryan Bloom wrote: > > > OK, but the config.cache should still be removed, surely? > > > > Also, BTW, the current version completely fails to build for me (lots of > > unresolved externals) - what's the current recommended build path? > > > > I'm slightly puzzled by what's going on with APR - it seems to build a > > dozen different libraries, but Apache only seems to use one. What am I > > missing? > > APR hasn't built a dozen different libraries for a long time. We are only > building the one libapr.a. Should I send a log? Perhaps there's a step missing in the build? I dunno. I'm confused. > What platform are you on? FreeBSD. > I have the code working just fine on Linux and > Windows. If you are using the prefork MPM, you have to specify > LIBS="-lpthread". I let it choose (it chose threaded). > If you are on any other platform, you are on your own. I'm _always_ on my own :-) > The configure script has basically been written on Linux, and it is > assumed it will be modified as we port 2.0. Consider me porting and modifying! Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
Re: cvs commit: apache-2.0/src buildconf configure.in
[EMAIL PROTECTED] wrote: > > manoj 99/12/19 17:54:40 > > Modified:src buildconf configure.in > Log: > Make Apache's configure script run APR's. OK, but the config.cache should still be removed, surely? Also, BTW, the current version completely fails to build for me (lots of unresolved externals) - what's the current recommended build path? I'm slightly puzzled by what's going on with APR - it seems to build a dozen different libraries, but Apache only seems to use one. What am I missing? Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/helpers build-modules-c.awk
ben 99/12/19 08:36:49 Modified:src/helpers build-modules-c.awk Log: Deal with newline at the end of the module list. Revision ChangesPath 1.2 +8 -1 apache-2.0/src/helpers/build-modules-c.awk Index: build-modules-c.awk === RCS file: /export/home/cvs/apache-2.0/src/helpers/build-modules-c.awk,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- build-modules-c.awk 1999/12/05 08:54:38 1.1 +++ build-modules-c.awk 1999/12/19 16:36:49 1.2 @@ -3,7 +3,14 @@ modules[n++] = "core" pmodules[pn++] = "core" } -{ modules[n++] = $1 ; pmodules[pn++] = $1 } +{ +modules[n] = $1; +pmodules[pn] = $1; +gsub("\n","",modules[n]); +gsub("\n","",pmodules[pn]); +++n; +++pn; +} END { print "/*" print " * modules.c --- automatically generated by Apache"
cvs commit: apache-2.0/src buildconf
ben 99/12/19 08:36:19 Modified:src buildconf Log: Build APR, too. Revision ChangesPath 1.2 +25 -0 apache-2.0/src/buildconf Index: buildconf === RCS file: /export/home/cvs/apache-2.0/src/buildconf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- buildconf 1999/11/29 23:44:50 1.1 +++ buildconf 1999/12/19 16:36:19 1.2 @@ -105,3 +105,28 @@ echo "buildconf: created or modified configure" fi +# Now do APR... + +echo "buildconf: setting up APR" + +cd lib/apr + +mv configure configure.old 2>/dev/null +autoconf +if cmp configure.old configure > /dev/null 2>&1; then +echo "buildconf: keeping configure" +mv configure.old configure +else +echo "buildconf: created or modified configure" +fi + +cd ../.. + +# Now run the configs... + +rm config.cache +./configure + +cd lib/apr +rm config.cache +./configure
cvs commit: apache-2.0/src/helpers build-acconfig-header
ben 99/12/19 08:12:38 Modified:src/helpers build-acconfig-header Log: Directory to use wasn't set. Revision ChangesPath 1.2 +2 -0 apache-2.0/src/helpers/build-acconfig-header Index: build-acconfig-header === RCS file: /export/home/cvs/apache-2.0/src/helpers/build-acconfig-header,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- build-acconfig-header 1999/11/29 23:45:28 1.1 +++ build-acconfig-header 1999/12/19 16:12:37 1.2 @@ -2,6 +2,8 @@ disclaimer="Do NOT edit - this file is generated by build-acconfig-header" +dir=. + # security check - simply overwriting existing files could be harmful if test -w acconfig.h.new ; then echo "Please remove acconfig.h.new and rerun this command"
Re: cvs commit: apache-1.3/cgi-bin printenv
Marc Slemko wrote: > > 5. surround values with quotes to allow one to better recognize newlines > > (as > > in SERVER_SIGNATURE) and whitespaces and also print newlines > > as \n and " as \" for a more Shell- and C-style syntax. > > Is it really standard to not display "'s normally, but to stick a \ in > front of them? I don't see that much. Standard or not, if you are going to do it, you really ought to replace \ with \\, too. Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
Re: cvs commit: apache-1.3/src/modules/standard mod_rewrite.c
[EMAIL PROTECTED] wrote: > > gstein 99/11/26 11:31:23 > > Modified:src/modules/standard mod_rewrite.c > Log: > The floating point rounding performed by the ap_snprintf() was throwing > off the distribution of the random value. Nah, what threw it off was that it was just plain wrong. Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-1.3/src/main http_request.c
ben 99/11/09 10:02:24 Modified:src/main http_request.c Log: Make sure that an error document that needs auth but hasn't got an auth type still reports a cascaded error. Revision ChangesPath 1.151 +1 -1 apache-1.3/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_request.c,v retrieving revision 1.150 retrieving revision 1.151 diff -u -r1.150 -r1.151 --- http_request.c1999/10/21 20:44:43 1.150 +++ http_request.c1999/11/09 18:02:19 1.151 @@ -1176,7 +1176,7 @@ case SATISFY_ANY: if (((access_status = ap_check_access(r)) != 0) || !ap_auth_type(r)) { if (!ap_some_auth_required(r)) { -decl_die(access_status, ap_auth_type(r) +decl_die(access_status ? access_status : HTTP_INTERNAL_SERVER_ERROR, ap_auth_type(r) ? "check access" : "perform authentication. AuthType not set!", r); return;
cvs commit: apache-2.0/src/modules/mpm/prefork prefork.c
ben 99/11/09 01:33:56 Modified:src/modules/mpm/prefork prefork.c Log: Fix error logging calls (kinda). Revision ChangesPath 1.50 +11 -9 apache-2.0/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- prefork.c 1999/10/24 13:08:29 1.49 +++ prefork.c 1999/11/09 09:33:52 1.50 @@ -202,7 +202,7 @@ } dir = ap_server_root_relative(pconf, buf[0] ? buf : dir); if(mkdir(dir, 0755) < 0 && errno != EEXIST) { - ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, errno, server_conf, "gprof: error creating directory %s", dir); } } @@ -603,10 +603,11 @@ static void accept_mutex_child_init(ap_context_t *p) { ap_file_t *tempfile; +ap_status_t ret; -ap_open(&tempfile, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE, p); -if (!tempfile) { - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, +ret=ap_open(&tempfile, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE, p); +if (ret != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_EMERG, ret, server_conf, "Child cannot open lock file: %s", ap_lock_fname); clean_child_exit(APEXIT_CHILDINIT); } @@ -620,13 +621,14 @@ static void accept_mutex_init(ap_context_t *p) { ap_file_t *tempfile; +ap_status_t ret; expand_lock_fname(p); unlink(ap_lock_fname); -ap_open(&tempfile, ap_lock_fname, APR_CREATE|APR_WRITE|APR_EXCL, +ret=ap_open(&tempfile, ap_lock_fname, APR_CREATE|APR_WRITE|APR_EXCL, APR_UREAD|APR_UWRITE, p); -if (!tempfile) { - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, +if (ret != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_EMERG, ret, server_conf, "Parent cannot open lock file: %s", ap_lock_fname); exit(APEXIT_INIT); } @@ -642,7 +644,7 @@ continue; if (ret < 0) { - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, errno, server_conf, "flock: LOCK_EX: Error getting accept lock. Exiting!"); clean_child_exit(APEXIT_CHILDFATAL); } @@ -651,7 +653,7 @@ static void accept_mutex_off(void) { if (flock(lock_fd, LOCK_UN) < 0) { - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, errno, server_conf, "flock: LOCK_UN: Error freeing accept lock. Exiting!"); clean_child_exit(APEXIT_CHILDFATAL); }
cvs commit: apache-2.0/src/main util_script.c
ben 99/11/09 01:01:18 Modified:src/lib/apr configure.in src/lib/apr/include apr_general.h src/main util_script.c Log: Add printf format for ssize_t. Revision ChangesPath 1.23 +9 -8 apache-2.0/src/lib/apr/configure.in Index: configure.in === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- configure.in 1999/10/21 21:13:15 1.22 +++ configure.in 1999/11/09 09:01:10 1.23 @@ -41,14 +41,6 @@ # This macro needs to be here in case we are on an AIX box. AC_AIX -dnl Checks for integer size -AC_CHECK_SIZEOF(char, 1) -AC_CHECK_SIZEOF(int, 4) -AC_CHECK_SIZEOF(long, 4) -AC_CHECK_SIZEOF(short, 2) -AC_CHECK_SIZEOF(long double, 12) -AC_CHECK_SIZEOF(long long, 8) - dnl Checks for standard typedefs AC_TYPE_OFF_T AC_TYPE_PID_T @@ -56,6 +48,15 @@ AC_TYPE_UID_T AC_CHECK_TYPE(ssize_t, int) AC_C_INLINE + +dnl Checks for integer size +AC_CHECK_SIZEOF(char, 1) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(long double, 12) +AC_CHECK_SIZEOF(long long, 8) +AC_CHECK_SIZEOF(ssize_t, 4) # Use /bin/sh if it exists, otherwise go looking for sh in the path if test ".$SH" = . -a -f /bin/sh; then 1.9 +8 -0 apache-2.0/src/lib/apr/include/apr_general.h Index: apr_general.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_general.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- apr_general.h 1999/11/09 08:53:53 1.8 +++ apr_general.h 1999/11/09 09:01:14 1.9 @@ -117,6 +117,14 @@ typedef ssize_tap_ssize_t; typedef off_t ap_off_t; +#if SIZEOF_SSIZE_T == SIZEOF_INT +# define APR_SSIZE_T_FMT "d" +#elif SIZEOF_SSIZE_T == SIZEOF_LONG +# define APR_SSIZE_T_FMT "ld" +#else +# error "Don't know ssize_t printf format" +#endif + typedef struct context_t ap_context_t; typedef int ap_signum_t; 1.18 +2 -2 apache-2.0/src/main/util_script.c Index: util_script.c === RCS file: /export/home/cvs/apache-2.0/src/main/util_script.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- util_script.c 1999/10/31 09:26:03 1.17 +++ util_script.c 1999/11/09 09:01:15 1.18 @@ -639,13 +639,13 @@ ap_rputs(" 1k", r); } else if (size < 1048576) { - ap_rprintf(r, "%4ldk", (size + 512) / 1024); + ap_rprintf(r, "%4" APR_SSIZE_T_FMT "k", (size + 512) / 1024); } else if (size < 103809024) { ap_rprintf(r, "%4.1fM", size / 1048576.0); } else { - ap_rprintf(r, "%4ldM", (size + 524288) / 1048576); + ap_rprintf(r, "%4" APR_SSIZE_T_FMT "M", (size + 524288) / 1048576); } }
cvs commit: apache-2.0/src/lib/apr/include apr_general.h
ben 99/11/09 00:53:53 Modified:src/lib/apr/include apr_general.h Log: configure makes sure ssize_t always exists. Revision ChangesPath 1.8 +0 -4 apache-2.0/src/lib/apr/include/apr_general.h Index: apr_general.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_general.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- apr_general.h 1999/10/11 01:39:21 1.7 +++ apr_general.h 1999/11/09 08:53:53 1.8 @@ -114,11 +114,7 @@ #endif typedef size_t ap_size_t; -#ifdef ssize_t typedef ssize_tap_ssize_t; -#else -typedef intap_ssize_t; -#endif typedef off_t ap_off_t; typedef struct context_t ap_context_t;
Re: cvs commit: apache-2.0/src/lib/apr/file_io/win32 fileacc.c
[EMAIL PROTECTED] wrote: > > stoddard99/11/02 06:24:57 > > Modified:src/lib/apr/file_io/win32 fileacc.c > Log: > call ap_getfileinfo if the file has not been stat'ed Eek! Can we use "statted" instead of "stated" for the member? This is bound to lead to confusion! Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/modules/standard mod_autoindex.c mod_log_config.c
ben 99/10/24 12:24:16 Modified:src/include util_script.h src/lib/apr/file_io/unix readwrite.c src/main buff.c http_protocol.c rfc1413.c util_script.c src/modules/standard mod_autoindex.c mod_log_config.c Log: Size rigour. Revision ChangesPath 1.3 +1 -1 apache-2.0/src/include/util_script.h Index: util_script.h === RCS file: /export/home/cvs/apache-2.0/src/include/util_script.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- util_script.h 1999/08/31 05:32:19 1.2 +++ util_script.h 1999/10/24 19:23:43 1.3 @@ -80,7 +80,7 @@ API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer, int (*getsfunc) (char *, int, void *), void *getsfunc_data); -API_EXPORT(void) ap_send_size(size_t size, request_rec *r); +API_EXPORT(void) ap_send_size(ap_ssize_t size, request_rec *r); API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0, char **env, int shellcmd); 1.14 +1 -1 apache-2.0/src/lib/apr/file_io/unix/readwrite.c Index: readwrite.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- readwrite.c 1999/10/19 11:19:28 1.13 +++ readwrite.c 1999/10/24 19:23:55 1.14 @@ -358,7 +358,7 @@ va_list ap; ap_vformatter_buff_t vbuff; char *buf; -int len; +ap_ssize_t len; buf = malloc(HUGE_STRING_LEN); if (buf == NULL) { 1.11 +6 -3 apache-2.0/src/main/buff.c Index: buff.c === RCS file: /export/home/cvs/apache-2.0/src/main/buff.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- buff.c1999/10/22 22:08:15 1.10 +++ buff.c1999/10/24 19:23:57 1.11 @@ -318,7 +318,8 @@ /* a wrapper around iol_read which checks for errors and EOFs */ static int read_with_errors(BUFF *fb, void *buf, int nbyte) { -int rv, bytes_read; +int rv; +ap_ssize_t bytes_read; rv = iol_read(fb->iol, buf, nbyte, &bytes_read); if (rv == APR_SUCCESS && bytes_read == 0) { @@ -541,7 +542,8 @@ */ static int writev_with_errors(BUFF *fb, const struct iovec *vec, int nvec) { -int rv, bytes_written; +int rv; +ap_ssize_t bytes_written; rv = iol_writev(fb->iol, vec, nvec, &bytes_written); if (rv != APR_SUCCESS) { @@ -687,7 +689,8 @@ */ static int write_with_errors(BUFF *fb, const void *buf, int nbyte) { -int rv, bytes_written; +int rv; +ap_ssize_t bytes_written; rv = iol_write(fb->iol, buf, nbyte, &bytes_written); if (rv != APR_SUCCESS) { 1.24 +1 -1 apache-2.0/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- http_protocol.c 1999/10/20 12:49:55 1.23 +++ http_protocol.c 1999/10/24 19:23:58 1.24 @@ -2012,7 +2012,7 @@ char buf[IOBUFSIZE]; long total_bytes_sent = 0; register int w, o; -int n; +ap_ssize_t n; ap_status_t status; if (length == 0) 1.8 +2 -2 apache-2.0/src/main/rfc1413.c Index: rfc1413.c === RCS file: /export/home/cvs/apache-2.0/src/main/rfc1413.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- rfc1413.c 1999/10/24 05:59:18 1.7 +++ rfc1413.c 1999/10/24 19:24:00 1.8 @@ -155,7 +155,7 @@ #endif i = 0; while(i < strlen(buffer)) { -int j = strlen(buffer + i); +ap_ssize_t j = strlen(buffer + i); ap_status_t status; status = ap_send(sock, buffer+i, &j); if (status != APR_SUCCESS && status != APR_EINTR) { @@ -181,7 +181,7 @@ * this allows it to work on both ASCII and EBCDIC machines. */ while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) { -int j = sizeof(buffer) - 1 - i; +ap_ssize_t j = sizeof(buffer) - 1 - i; ap_status_t status; status = ap_recv(sock, buffer+i, &j); if (status != APR_SUCCESS && status != APR_EINTR) { 1.1
Re: cvs commit: apache-2.0/src/modules/standard mod_cgi.c
[EMAIL PROTECTED] wrote: > > stoddard99/10/12 07:45:59 > > Modified:src/modules/standard mod_cgi.c > Log: > Fix bug interpreting cgi_child return code. Do some clean-up. > > Revision ChangesPath > 1.8 +6 -16 apache-2.0/src/modules/standard/mod_cgi.c > > Index: mod_cgi.c > === > RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgi.c,v > retrieving revision 1.7 > retrieving revision 1.8 > diff -u -r1.7 -r1.8 > --- mod_cgi.c 1999/10/12 04:06:58 1.7 > +++ mod_cgi.c 1999/10/12 14:45:57 1.8 > @@ -295,7 +295,7 @@ >char *argv0; >}; > > -static int cgi_child(struct cgi_child_stuff *child_stuff, > +static ap_status_t cgi_child(struct cgi_child_stuff *child_stuff, > BUFF **script_out, BUFF **script_in, BUFF > **script_err) >{ >struct cgi_child_stuff *cld = child_stuff; > @@ -308,7 +308,7 @@ >ap_procattr_t *procattr; >ap_proc_t *procnew; >ap_os_proc_t fred; > -int rc; > +ap_status_t rc = APR_SUCCESS; > >#ifdef DEBUG_CGI >#ifdef OS2 > @@ -346,11 +346,6 @@ > * NB only ISINDEX scripts get decoded arguments. > */ > > -#ifdef TPF > -ap_unblock_alarms(); > - > -return (0); > -#else >ap_cleanup_for_exec(); > >if ((ap_createprocattr_init(&procattr, child_context) != APR_SUCCESS) > || > @@ -363,9 +358,7 @@ >/* Something bad happened, tell the world. */ > ap_log_rerror(APLOG_MARK, APLOG_ERR, r, > "couldn't create child process: %s", r->filename); > -ap_unblock_alarms(); > - > -return (-1); > +rc = !APR_SUCCESS; Errr, what? If the thing fails, you are supposed to return the error! Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/modules/mpm/mpmt_pthread acceptlock.c acceptlock.h mpmt_pthread.c
ben 99/10/10 10:08:10 Modified:src Configure src/lib/apr configure.in src/lib/apr/include apr_network_io.h src/lib/apr/network_io/unix networkio.h poll.c sockets.c src/modules/mpm/mpmt_pthread acceptlock.c acceptlock.h mpmt_pthread.c Log: Attempt to port mpmt_pthreads to APR, but threads seem to be broken on my plaform so it is only partially tested. Revision ChangesPath 1.11 +10 -3 apache-2.0/src/Configure Index: Configure === RCS file: /export/home/cvs/apache-2.0/src/Configure,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Configure 1999/10/10 12:17:42 1.10 +++ Configure 1999/10/10 17:07:53 1.11 @@ -1724,15 +1724,24 @@ ## Add in the APR library. ## +TEXTRA_CFLAGS=`egrep '^EXTRA_CFLAGS=' Makefile.config | tail -1 |\ +sed -e 's;^EXTRA_CFLAGS=;;' -e 's;\`.*\`;;'` + if [ -d ./lib/apr ]; then if helpers/PrintPath -s autoconf; then echo " + bootstrapping Apache Portable Runtime (APR)" (cd lib/apr && autoconf && autoheader) fi echo " + configuring Apache Portable Runtime (APR)" +APR_FLAGS=`egrep ^APR_FLAGS= $file|sed -e 's/APR_FLAGS='//` +if [ "x$APR_FLAGS" != "x" ]; then + echo "o with flags: $APR_FLAGS" +fi cd lib/apr stripped_CFLAGS=`echo "$CFLAGS " | sed -e 's/-DTARGET[^ ]*//'` # FIXME -CC="$CC" CFLAGS="$TEXTRA_CFLAGS $stripped_CFLAGS" OPTIM="$TOPTIM $OPTIM" ./configure >/dev/null +# configure fails with -Werror, because it writes crap C for its tests... +stripped_TEXTRA_CFLAGS=`echo "$TEXTRA_CFLAGS" | sed -e 's/-Werror//'` +CC="$CC" CFLAGS="$stripped_TEXTRA_CFLAGS $stripped_CFLAGS" OPTIM="$TOPTIM $OPTIM" ./configure $APR_FLAGS > /dev/null if [ $? -ne 0 ]; then echo "** FAILED to configure APR" exit 1 @@ -2161,8 +2170,6 @@ ## ap_config_auto.h so they are available to external modules needing to ## include Apache header files. ## -TEXTRA_CFLAGS=`egrep '^EXTRA_CFLAGS=' Makefile.config | tail -1 |\ -sed -e 's;^EXTRA_CFLAGS=;;' -e 's;\`.*\`;;'` tmpstr=`echo $CFLAGS $TEXTRA_CFLAGS |\ sed -e 's;[ ]\([+-]\);!\1;g' -e 's/\([^\\\]\)"/\1/g' -e 's/\\\"/\"/g'` OIFS="$IFS" 1.16 +3 -0 apache-2.0/src/lib/apr/configure.in Index: configure.in === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- configure.in 1999/10/08 16:07:38 1.15 +++ configure.in 1999/10/10 17:07:57 1.16 @@ -28,6 +28,9 @@ AC_CHECK_PROG(RM, rm, rm) AC_CHECK_PROG(AR, ar, ar) +AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings], + [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi]) + dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$OS:$CC" in 1.9 +6 -3 apache-2.0/src/lib/apr/include/apr_network_io.h Index: apr_network_io.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- apr_network_io.h 1999/10/04 16:36:54 1.8 +++ apr_network_io.h 1999/10/10 17:07:59 1.9 @@ -128,9 +128,12 @@ ap_status_t ap_getport(ap_socket_t *, ap_uint32_t *); ap_status_t ap_getipaddr(char *buf, ap_ssize_t len, const ap_socket_t *sock); -ap_status_t ap_setup_poll(ap_pollfd_t **, ap_context_t *, ap_int32_t); -ap_status_t ap_poll(ap_pollfd_t *, ap_int32_t *, ap_int32_t); -ap_status_t ap_add_poll_socket(ap_pollfd_t *, ap_socket_t *, ap_int16_t); +ap_status_t ap_setup_poll(ap_pollfd_t **pollset, ap_context_t *ctx, + ap_int32_t nsocks); +ap_status_t ap_poll(struct pollfd_t *pollset, ap_int32_t *nsocks, + ap_int32_t timeout); +ap_status_t ap_add_poll_socket(ap_pollfd_t *pollset, ap_socket_t *sock, +ap_int16_t events); ap_status_t ap_remove_poll_socket(ap_pollfd_t *, ap_socket_t *, ap_int16_t); ap_status_t ap_clear_poll_sockets(ap_po
cvs commit: apache-2.0/src/lib/apr/network_io/unix poll.c
ben 99/10/10 06:19:58 Modified:src/lib/apr/network_io/unix poll.c Log: Use the correct size everywhere. Revision ChangesPath 1.11 +1 -1 apache-2.0/src/lib/apr/network_io/unix/poll.c Index: poll.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/poll.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- poll.c1999/10/10 13:15:58 1.10 +++ poll.c1999/10/10 13:19:57 1.11 @@ -174,7 +174,7 @@ int rv; pollset = (struct pollfd *)ap_palloc(aprset->cntxt, - sizeof(struct pollfd) * (*nsds)); + sizeof(struct pollfd) * aprset->curpos); for (i = 0; i < aprset->curpos; i++) { pollset[i].fd = aprset->sock[i];
cvs commit: apache-2.0/src/lib/apr/network_io/unix poll.c
ben 99/10/10 06:15:58 Modified:src/lib/apr/network_io/unix poll.c Log: Use the correct size for the pollset. Revision ChangesPath 1.10 +3 -3 apache-2.0/src/lib/apr/network_io/unix/poll.c Index: poll.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/poll.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- poll.c1999/10/08 20:04:17 1.9 +++ poll.c1999/10/10 13:15:58 1.10 @@ -176,7 +176,7 @@ pollset = (struct pollfd *)ap_palloc(aprset->cntxt, sizeof(struct pollfd) * (*nsds)); -for (i = 0; i < (*nsds); i++) { +for (i = 0; i < aprset->curpos; i++) { pollset[i].fd = aprset->sock[i]; pollset[i].events = aprset->events[i]; } @@ -185,10 +185,10 @@ timeout *= 1000; } -rv = poll(pollset, (*nsds), timeout); +rv = poll(pollset, aprset->curpos, timeout); (*nsds) = rv; -for (i = 0; i < (*nsds); i++) { +for (i = 0; i < aprset->curpos; i++) { aprset->revents[i] = get_revent(pollset[i].revents); }
cvs commit: apache-2.0/src/lib/apr/include .cvsignore
ben 99/10/10 05:19:59 Modified:src/lib/apr/include .cvsignore Log: Ingore autoheader output. Revision ChangesPath 1.2 +1 -0 apache-2.0/src/lib/apr/include/.cvsignore Index: .cvsignore === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore1999/09/10 16:06:59 1.1 +++ .cvsignore1999/10/10 12:19:58 1.2 @@ -1 +1,2 @@ apr_config.h +apr_config.h.in
cvs commit: apache-2.0/src Configure
ben 99/10/10 05:17:42 Modified:src Configure Log: Always use autoconf if available. Revision ChangesPath 1.10 +1 -1 apache-2.0/src/Configure Index: Configure === RCS file: /export/home/cvs/apache-2.0/src/Configure,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Configure 1999/10/09 20:28:40 1.9 +++ Configure 1999/10/10 12:17:42 1.10 @@ -1725,7 +1725,7 @@ ## Add in the APR library. ## if [ -d ./lib/apr ]; then -if [ ! -f ./lib/apr/configure ]; then +if helpers/PrintPath -s autoconf; then echo " + bootstrapping Apache Portable Runtime (APR)" (cd lib/apr && autoconf && autoheader) fi
Re: cvs commit: apache-2.0/src Configure
[EMAIL PROTECTED] wrote: > > manoj 99/10/09 13:28:41 > > Modified:src Configure > Log: > Make Configure run autoheader in the APR directory. > > Revision ChangesPath > 1.9 +1 -1 apache-2.0/src/Configure > > Index: Configure > === > RCS file: /home/cvs/apache-2.0/src/Configure,v > retrieving revision 1.8 > retrieving revision 1.9 > diff -u -d -u -r1.8 -r1.9 > --- Configure 1999/10/01 16:22:48 1.8 > +++ Configure 1999/10/09 20:28:40 1.9 > @@ -1727,7 +1727,7 @@ >if [ -d ./lib/apr ]; then >if [ ! -f ./lib/apr/configure ]; then >echo " + bootstrapping Apache Portable Runtime (APR)" > -(cd lib/apr && autoconf) > +(cd lib/apr && autoconf && autoheader) Ah. This really ought to be triggered by the existence of autoconf, or it doesn't actually help much (after the first time), does it? Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/modules/standard mod_asis.c
ben 99/10/05 04:57:42 Modified:src/modules/mpm/prefork prefork.c src/modules/standard mod_asis.c Log: Use new parameter orders. Revision ChangesPath 1.37 +2 -2 apache-2.0/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- prefork.c 1999/10/04 16:38:14 1.36 +++ prefork.c 1999/10/05 11:57:40 1.37 @@ -624,8 +624,8 @@ expand_lock_fname(p); unlink(ap_lock_fname); -ap_open(p, ap_lock_fname, APR_CREATE|APR_WRITE|APR_EXCL, - APR_UREAD|APR_UWRITE, &tempfile); +ap_open(&tempfile, p, ap_lock_fname, APR_CREATE|APR_WRITE|APR_EXCL, + APR_UREAD|APR_UWRITE); if (!tempfile) { ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "Parent cannot open lock file: %s", ap_lock_fname); 1.6 +1 -1 apache-2.0/src/modules/standard/mod_asis.c Index: mod_asis.c === RCS file: /export/home/cvs/apache-2.0/src/modules/standard/mod_asis.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- mod_asis.c1999/10/04 16:38:15 1.5 +++ mod_asis.c1999/10/05 11:57:41 1.6 @@ -114,7 +114,7 @@ if (!r->header_only) { ap_off_t zero = 0; ap_seek(f, APR_CUR, &zero); - ap_send_fd(thefd, r); + ap_send_fd(f, r); } ap_close(f);
cvs commit: apache-2.0/src/lib/apr/network_io/unix poll.c
ben 99/10/05 04:13:14 Modified:src/lib/apr/network_io/unix poll.c Log: Use new parameter ordering. Revision ChangesPath 1.8 +1 -2 apache-2.0/src/lib/apr/network_io/unix/poll.c Index: poll.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/poll.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- poll.c1999/10/04 16:37:11 1.7 +++ poll.c1999/10/05 11:13:09 1.8 @@ -283,8 +283,7 @@ #else/* Use select to mimic poll */ -ap_status_t ap_setup_poll(ap_context_t *cont, ap_int32_t num, struct pollfd_t ** -new) +ap_status_t ap_setup_poll(struct pollfd_t **new, ap_context_t *cont, ap_int32_t num) { (*new) = (struct pollfd_t *)ap_palloc(cont, sizeof(struct pollfd_t) * num); if ((*new) == NULL) {
Re: cvs commit: apache-1.3/src/main util.c
[EMAIL PROTECTED] wrote: > > bjh 99/09/18 03:57:08 > > Modified:src/main util.c > Log: > Configuration files are text files so open them in text mode. > > Some OS/2 (and probably DOS & Windows) text editors like to put Ctrl-Z EOF > markers at the end of the files they edit. Opening the config files in text > mode prevents the Ctrl-Z from causing 'Invalid command' errors when > starting. Nice. I don't think DOS/Windows understand "rt" - they do the opposite ("rb" for binary). Don't think it hurts, though. Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/main listen.c
ben 99/09/18 04:48:17 Modified:src/lib/apr/include apr_network_io.h src/lib/apr/network_io/unix sockets.c src/main listen.c Log: Make ap_getipaddr threadsafe. Revision ChangesPath 1.6 +1 -1 apache-2.0/src/lib/apr/include/apr_network_io.h Index: apr_network_io.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- apr_network_io.h 1999/09/14 13:37:21 1.5 +++ apr_network_io.h 1999/09/18 11:48:14 1.6 @@ -126,7 +126,7 @@ ap_status_t ap_setport(ap_socket_t *, ap_uint32_t); ap_status_t ap_setipaddr(ap_socket_t *, const char *); ap_status_t ap_getport(ap_socket_t *, ap_uint32_t *); -ap_status_t ap_getipaddr(ap_socket_t *, char **); +ap_status_t ap_getipaddr(char *buf, ap_ssize_t len, const ap_socket_t *sock); ap_status_t ap_setup_poll(ap_context_t *, ap_int32_t, ap_pollfd_t **); ap_status_t ap_poll(ap_pollfd_t *, ap_int32_t *, ap_int32_t); 1.8 +7 -5 apache-2.0/src/lib/apr/network_io/unix/sockets.c Index: sockets.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockets.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- sockets.c 1999/09/14 13:37:24 1.7 +++ sockets.c 1999/09/18 11:48:16 1.8 @@ -196,15 +196,17 @@ } /* ***APRDOC - * ap_status_t ap_getipaddr(ap_socket_t *, char **addr) + * ap_status_t ap_getipaddr(char *addr, int len, const ap_socket_t *) *Return the IP address associated with an apr socket. - * arg 1) The socket to use - * arg 2) The IP address associated with the socket. + * arg 1) A buffer for the IP address associated with the socket. + * arg 2) The total length of the buffer (including terminating NUL) + * arg 3) The socket to use */ -ap_status_t ap_getipaddr(struct socket_t *sock, char **addr) +ap_status_t ap_getipaddr(char *addr, ap_ssize_t len, + const struct socket_t *sock) { char *temp = inet_ntoa(sock->addr->sin_addr); -*addr=temp; +ap_cpystrn(addr,temp,len-1); return APR_SUCCESS; } 1.8 +2 -2 apache-2.0/src/main/listen.c Index: listen.c === RCS file: /export/home/cvs/apache-2.0/src/main/listen.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- listen.c 1999/09/08 14:15:43 1.7 +++ listen.c 1999/09/18 11:48:17 1.8 @@ -153,13 +153,13 @@ { ap_listen_rec **walk; ap_listen_rec *new; -char *oldaddr; +char oldaddr[17]; unsigned int oldport; /* see if we've got an old listener for this address:port */ for (walk = &old_listeners; *walk; walk = &(*walk)->next) { ap_getport((*walk)->sd, &oldport); -ap_getipaddr((*walk)->sd, &oldaddr); + ap_getipaddr(oldaddr,sizeof oldaddr,(*walk)->sd); if (!strcmp(oldaddr, addr) && port == oldport) { /* re-use existing record */ new = *walk;
Re: cvs commit: apache-2.0/src/lib/apr/file_io/unix open.c
Ryan Bloom wrote: > > > > > -if ((*new)->filedes < 0 && (*new)->filehand == NULL) { > > +if ((*new)->filedes < 0 || (*new)->filehand == NULL) { > > (*new)->filedes = -1; > > (*new)->eof_hit = 1; > >return errno; > > This is wrong. This says that we NEVER open the file correctly. This is > because we only ever set one of the two options, either the filedes or the > filehand, NEVER both. Yeah but filedes == 0 when you use filehand (which is possibly a bug). > We are checking for the error condition, not the > successful case. Either the filedes or the filehand WILL be not set after > each open. I have serious doubts that the code even works anymore. If > it does, it is only because we aren't checking return code properly. OK, well it didn't work before, and it now does _when_ it is using filehand. I agree this it is still broken, though, but less so than before. Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/lib/apr/file_io/unix open.c
ben 99/09/12 05:10:12 Modified:src/lib/apr/file_io/unix open.c Log: Initialise data structure correctly in ap_put_os_file. Revision ChangesPath 1.10 +1 -1 apache-2.0/src/lib/apr/file_io/unix/open.c Index: open.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- open.c1999/09/12 10:52:14 1.9 +++ open.c1999/09/12 12:10:11 1.10 @@ -250,7 +250,7 @@ { int *dafile = thefile; if ((*file) == NULL) { -(*file) = (struct file_t *)ap_palloc(cont, sizeof(struct file_t)); +(*file) = ap_pcalloc(cont, sizeof(struct file_t)); (*file)->cntxt = cont; } (*file)->filedes = *dafile;
cvs commit: apache-2.0/src/lib/apr/network_io/unix sockets.c
ben 99/09/12 04:19:30 Modified:src/lib/apr/network_io/unix sockets.c Log: Make ap_getipaddr return the buffer, rather than copy it. Revision ChangesPath 1.6 +2 -2 apache-2.0/src/lib/apr/network_io/unix/sockets.c Index: sockets.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockets.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- sockets.c 1999/09/07 21:24:44 1.5 +++ sockets.c 1999/09/12 11:19:30 1.6 @@ -196,7 +196,7 @@ } /* ***APRDOC - * ap_status_t ap_getipaddr(ap_socket_t *, char *addr) + * ap_status_t ap_getipaddr(ap_socket_t *, char **addr) *Return the IP address associated with an apr socket. * arg 1) The socket to use * arg 2) The IP address associated with the socket. @@ -204,7 +204,7 @@ ap_status_t ap_getipaddr(struct socket_t *sock, char **addr) { char *temp = inet_ntoa(sock->addr->sin_addr); -strcpy(*addr, temp); +*addr=temp; return APR_SUCCESS; }
cvs commit: apache-2.0/src/lib/apr/time/unix time.c
ben 99/09/12 04:12:55 Modified:src/lib/apr/misc/unix start.c src/lib/apr/signal/unix signal.c src/lib/apr/time/unix time.c Log: Fix warnings. Revision ChangesPath 1.4 +3 -0 apache-2.0/src/lib/apr/misc/unix/start.c Index: start.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/misc/unix/start.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- start.c 1999/08/31 05:32:43 1.3 +++ start.c 1999/09/12 11:12:53 1.4 @@ -61,6 +61,9 @@ #include #include #include +#ifdef HAVE_STDLIB_H +# include +#endif /* ***APRDOC * ap_status_t ap_create_context(ap_context_t *, void *, ap_context_t **) 1.2 +2 -1 apache-2.0/src/lib/apr/signal/unix/signal.c Index: signal.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/signal/unix/signal.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- signal.c 1999/08/17 15:59:46 1.1 +++ signal.c 1999/09/12 11:12:54 1.2 @@ -100,7 +100,8 @@ * arg 2) The signal we are expecting to receive. Same as above list * arg 3) The function to execute when this signal is received. */ -ap_setup_signal(ap_context_t *cont, ap_signum_t signum, Sigfunc *func) +ap_status_t ap_setup_signal(ap_context_t *cont, ap_signum_t signum, + Sigfunc *func) { sigset_t newset; 1.3 +0 -1 apache-2.0/src/lib/apr/time/unix/time.c Index: time.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/time/unix/time.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- time.c1999/08/30 15:20:14 1.2 +++ time.c1999/09/12 11:12:54 1.3 @@ -89,7 +89,6 @@ */ ap_status_t ap_current_time(struct atime_t *new) { -struct timeval newtime; new->currtime = ap_palloc(new->cntxt, sizeof(struct timeval)); gettimeofday(new->currtime, NULL); return APR_SUCCESS;
cvs commit: apache-2.0/src/lib/apr/locks/unix crossproc.c
ben 99/09/12 04:09:48 Modified:src/lib/apr/locks/unix crossproc.c Log: Fix numerous cockups where values are tested instead of set, and a few warnings. Revision ChangesPath 1.3 +9 -6 apache-2.0/src/lib/apr/locks/unix/crossproc.c Index: crossproc.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/locks/unix/crossproc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- crossproc.c 1999/08/31 05:32:41 1.2 +++ crossproc.c 1999/09/12 11:09:47 1.3 @@ -55,6 +55,7 @@ #include "apr_lock.h" #include "apr_general.h" +#include "apr_lib.h" #include "locks.h" #include #include @@ -229,13 +230,15 @@ #elif defined (USE_FCNTL_SERIALIZE) -ap_status_t lock_cleanup(struct lock_t *lock) +ap_status_t lock_cleanup(void *lock_) { +struct lock_t *lock=lock_; + if (lock->curr_locked == 1) { if (fcntl(lock->interproc, F_SETLKW, &lock->unlock_it) < 0) { return errno; } -lock->curr_locked == 0; +lock->curr_locked=0; } return APR_SUCCESS; } @@ -260,15 +263,15 @@ new->unlock_it.l_type = F_UNLCK; /* set exclusive/write lock */ new->unlock_it.l_pid = 0;/* pid not actually interesting */ -new->curr_locked == 0; +new->curr_locked=0; unlink(new->fname); -ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, NULL); +ap_register_cleanup(new->cntxt, new, lock_cleanup, NULL); return APR_SUCCESS; } ap_status_t lock_inter(struct lock_t *lock) { -lock->curr_locked == 1; +lock->curr_locked=1; if (fcntl(lock->interproc, F_SETLKW, &lock->lock_it) < 0) { return errno; } @@ -280,7 +283,7 @@ if (fcntl(lock->interproc, F_SETLKW, &lock->unlock_it) < 0) { return errno; } -lock->curr_locked == 0; +lock->curr_locked=0; return APR_SUCCESS; }
cvs commit: apache-2.0/src/lib/apr/threadproc/unix procsup.c thread.c threadcancel.c threadpriv.c
ben 99/09/12 04:06:27 Modified:src/lib/apr/locks/unix locks.c locks.h src/lib/apr/threadproc/unix procsup.c thread.c threadcancel.c threadpriv.c Log: Fix warnings. Revision ChangesPath 1.2 +1 -0 apache-2.0/src/lib/apr/locks/unix/locks.c Index: locks.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- locks.c 1999/08/17 15:59:42 1.1 +++ locks.c 1999/09/12 11:06:25 1.2 @@ -55,6 +55,7 @@ #include "apr_general.h" #include "apr_portable.h" +#include "apr_lib.h" #include "locks.h" #include 1.2 +13 -0 apache-2.0/src/lib/apr/locks/unix/locks.h Index: locks.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- locks.h 1999/08/17 15:59:42 1.1 +++ locks.h 1999/09/12 11:06:25 1.2 @@ -108,5 +108,18 @@ */ }; +ap_status_t create_intra_lock(struct lock_t *new); +ap_status_t lock_intra(struct lock_t *lock); +ap_status_t unlock_intra(struct lock_t *lock); +ap_status_t destroy_intra_lock(struct lock_t *lock); + +ap_status_t create_inter_lock(struct lock_t *new); +ap_status_t lock_inter(struct lock_t *lock); +ap_status_t unlock_inter(struct lock_t *lock); +ap_status_t destroy_inter_lock(struct lock_t *lock); + +ap_status_t child_init_lock(ap_context_t *cont, char *fname, + struct lock_t **lock); + #endif /* LOCKS_H */ 1.2 +2 -0 apache-2.0/src/lib/apr/threadproc/unix/procsup.c Index: procsup.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/threadproc/unix/procsup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- procsup.c 1999/08/17 15:59:50 1.1 +++ procsup.c 1999/09/12 11:06:26 1.2 @@ -128,6 +128,8 @@ if (freopen("/dev/null", "w", stderr) == NULL) { return APR_STDERR; } + +return APR_SUCCESS; } /* ***APRDOC 1.2 +2 -0 apache-2.0/src/lib/apr/threadproc/unix/thread.c Index: thread.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/threadproc/unix/thread.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- thread.c 1999/08/17 15:59:50 1.1 +++ thread.c 1999/09/12 11:06:26 1.2 @@ -57,6 +57,7 @@ #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_portable.h" +#include "apr_lib.h" #ifdef HAVE_PTHREAD_H /* ***APRDOC @@ -179,6 +180,7 @@ { ap_destroy_pool(thd->cntxt); pthread_exit(retval); +return APR_SUCCESS; } /* ***APRDOC 1.2 +3 -0 apache-2.0/src/lib/apr/threadproc/unix/threadcancel.c Index: threadcancel.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/threadproc/unix/threadcancel.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- threadcancel.c1999/08/17 15:59:50 1.1 +++ threadcancel.c1999/09/12 11:06:26 1.2 @@ -58,6 +58,8 @@ #include "apr_general.h" #ifdef HAVE_PTHREAD_H + +#if 0 /* some platforms, e.g. FreeBSD 2.2.8, do not have pthread_cancel (they do have an undocumented pthread_kill, though) */ /* ***APRDOC * ap_status_t ap_cancel_thread(ap_thread_t *) *Asynchronously kill a thread @@ -73,6 +75,7 @@ return stat; } } +#endif /* ***APRDOC * ap_status_t ap_setcanceltype(ap_context_t *, ap_int32_t) 1.2 +1 -0 apache-2.0/src/lib/apr/threadproc/unix/threadpriv.c Index: threadpriv.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/threadproc/unix/threadpriv.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- threadpriv.c 1999/08/17 15:59:50 1.1 +++ threadpriv.c 1999/09/12 11:06:27 1.2 @@ -58,6 +58,7 @@ #include "apr_general.h" #include "apr_errno.h" #include "apr_portable.h" +#include "apr_lib.h" #ifdef HAVE_PTHREAD_H /* ***APRDOC
cvs commit: apache-2.0/src/lib/apr/file_io/unix readwrite.c
ben 99/09/12 03:54:37 Modified:src/lib/apr/file_io/unix readwrite.c Log: Detect EOF correctly, fix a couple of minor warnings. Revision ChangesPath 1.8 +10 -4 apache-2.0/src/lib/apr/file_io/unix/readwrite.c Index: readwrite.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- readwrite.c 1999/09/12 10:52:14 1.7 +++ readwrite.c 1999/09/12 10:54:37 1.8 @@ -217,9 +217,14 @@ ssize_t rv; if (thefile->buffered) { -if ((*ch) = fgetc(thefile->filehand)) { -return APR_SUCCESS; -} +int r; + + r=fgetc(thefile->filehand); + if(r != EOF) + { + *ch=(char)r; + return APR_SUCCESS; + } if (feof(thefile->filehand)) { return APR_EOF; } @@ -245,7 +250,6 @@ ap_status_t ap_puts(ap_file_t *thefile, char *str) { ssize_t rv; -int i = 0; int len; if (thefile->buffered) { @@ -320,6 +324,7 @@ return APR_SUCCESS; } +#if 0 /* not currently used */ static int printf_flush(ap_vformatter_buff_t *vbuff) { /* I would love to print this stuff out to the file, but I will @@ -327,6 +332,7 @@ */ return -1; } +#endif API_EXPORT(int) ap_fprintf(struct file_t *fptr, const char *format, ...) {
cvs commit: apache-2.0/src/lib/apr/lib apr_fnmatch.c apr_pools.c apr_snprintf.c
ben 99/09/12 03:52:18 Modified:src/lib/apr/file_io/unix filedup.c open.c readwrite.c src/lib/apr/include apr_lib.h src/lib/apr/lib apr_fnmatch.c apr_pools.c apr_snprintf.c Log: Fix warnings. Revision ChangesPath 1.2 +2 -0 apache-2.0/src/lib/apr/file_io/unix/filedup.c Index: filedup.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/filedup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- filedup.c 1999/08/17 15:59:36 1.1 +++ filedup.c 1999/09/12 10:52:13 1.2 @@ -86,6 +86,8 @@ case O_RDWR: buf_oflags = "r+"; break; + default: + return APR_BADARG; } (*new_file)->filehand = freopen(old_file->fname, buf_oflags, old_file->filehand); 1.9 +1 -3 apache-2.0/src/lib/apr/file_io/unix/open.c Index: open.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- open.c1999/09/11 20:42:58 1.8 +++ open.c1999/09/12 10:52:14 1.9 @@ -106,7 +106,6 @@ ap_status_t ap_open(ap_context_t *cont, const char *fname, ap_int32_t flag, ap_fileperms_t perm, struct file_t **new) { int oflags = 0; -struct stat info; mode_t mode = get_fileperms(perm); char *buf_oflags; @@ -266,7 +265,6 @@ */ ap_status_t ap_eof(ap_file_t *fptr) { -char ch; if (fptr->buffered) { if (feof(fptr->filehand) == 0) { return APR_SUCCESS; @@ -276,6 +274,6 @@ if (fptr->eof_hit == 1) { return APR_EOF; } -APR_SUCCESS; +return APR_SUCCESS; } 1.7 +0 -2 apache-2.0/src/lib/apr/file_io/unix/readwrite.c Index: readwrite.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- readwrite.c 1999/09/11 15:48:46 1.6 +++ readwrite.c 1999/09/12 10:52:14 1.7 @@ -194,8 +194,6 @@ */ ap_status_t ap_ungetc(ap_file_t *thefile, char ch) { -ssize_t rv; - if (thefile->buffered) { if (ungetc(ch, thefile->filehand) == ch) { thefile->stated = 0; 1.8 +2 -2 apache-2.0/src/lib/apr/include/apr_lib.h Index: apr_lib.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_lib.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- apr_lib.h 1999/09/08 18:04:10 1.7 +++ apr_lib.h 1999/09/12 10:52:16 1.8 @@ -399,8 +399,8 @@ */ /*#ifdef TPF*/ -#define ap_block_alarms() (0) -#define ap_unblock_alarms() (0) +#define ap_block_alarms() +#define ap_unblock_alarms() /*#else API_EXPORT(void) ap_block_alarms(void); API_EXPORT(void) ap_unblock_alarms(void); 1.3 +3 -0 apache-2.0/src/lib/apr/lib/apr_fnmatch.c Index: apr_fnmatch.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/lib/apr_fnmatch.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- apr_fnmatch.c 1999/08/31 05:32:34 1.2 +++ apr_fnmatch.c 1999/09/12 10:52:17 1.3 @@ -48,6 +48,9 @@ #include "apr_fnmatch.h" #include "apr_lib.h" #include +#ifdef HAVE_CTYPE_H +# include +#endif #define EOS '\0' 1.9 +1 -1 apache-2.0/src/lib/apr/lib/apr_pools.c Index: apr_pools.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/lib/apr_pools.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- apr_pools.c 1999/09/08 19:56:21 1.8 +++ apr_pools.c 1999/09/12 10:52:17 1.9 @@ -802,7 +802,6 @@ blok = a->last; first_avail = blok->h.first_avail; -new_first_avail; if (reqsize <= 0) { return NULL; @@ -1174,6 +1173,7 @@ API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) { /* do nothing cleanup routine */ +return APR_SUCCESS; } /* 1.2 +3 -0 apache-2.0/src/lib/apr/lib/apr_snprintf.c Index: apr_snprintf.c === RCS file: /export/home/cvs/apache-2.0/src/lib/
cvs commit: apache-2.0/src/main http_core.c http_protocol.c
ben 99/09/11 15:14:43 Modified:src/include http_protocol.h src/main http_core.c http_protocol.c Log: Fix warnings. Revision ChangesPath 1.5 +2 -1 apache-2.0/src/include/http_protocol.h Index: http_protocol.h === RCS file: /export/home/cvs/apache-2.0/src/include/http_protocol.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_protocol.h 1999/09/08 14:15:40 1.4 +++ http_protocol.h 1999/09/11 22:14:35 1.5 @@ -173,7 +173,8 @@ /* Sending a byterange */ API_EXPORT(int) ap_set_byterange(request_rec *r); -API_EXPORT(int) ap_each_byterange(request_rec *r, long *offset, long *length); +API_EXPORT(int) ap_each_byterange(request_rec *r, ap_off_t *offset, + long *length); /* Support for the Basic authentication protocol. Note that there's * nothing that prevents these from being in mod_auth.c, except that other 1.12 +2 -1 apache-2.0/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- http_core.c 1999/09/08 14:15:42 1.11 +++ http_core.c 1999/09/11 22:14:36 1.12 @@ -2624,7 +2624,8 @@ ap_send_mmap(mm, r, 0, r->finfo.st_size); } else { - long offset, length; + ap_off_t offset; + long length; while (ap_each_byterange(r, &offset, &length)) { ap_send_mmap(mm, r, offset, length); } 1.15 +6 -4 apache-2.0/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- http_protocol.c 1999/09/08 14:15:43 1.14 +++ http_protocol.c 1999/09/11 22:14:37 1.15 @@ -122,8 +122,8 @@ return (*start > 0 || *end < clength - 1); } -static int internal_byterange(int, long *, request_rec *, const char **, long *, - long *); +static int internal_byterange(int, long *, request_rec *, const char **, + ap_off_t *, long *); API_EXPORT(int) ap_set_byterange(request_rec *r) { @@ -198,7 +198,8 @@ return 1; } -API_EXPORT(int) ap_each_byterange(request_rec *r, long *offset, long *length) +API_EXPORT(int) ap_each_byterange(request_rec *r, ap_off_t *offset, + long *length) { return internal_byterange(1, NULL, r, &r->range, offset, length); } @@ -214,7 +215,8 @@ * when done. */ static int internal_byterange(int realreq, long *tlength, request_rec *r, - const char **r_range, long *offset, long *length) + const char **r_range, ap_off_t *offset, + long *length) { long range_start, range_end; char *range;
cvs commit: apache-2.0/src/modules/standard mod_negotiation.c
ben 99/09/11 15:14:12 Modified:src/modules/standard mod_negotiation.c Log: Use return status instead of character value for EOF. Revision ChangesPath 1.5 +3 -2 apache-2.0/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c === RCS file: /export/home/cvs/apache-2.0/src/modules/standard/mod_negotiation.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mod_negotiation.c 1999/09/08 14:15:55 1.4 +++ mod_negotiation.c 1999/09/11 22:14:11 1.5 @@ -678,8 +678,9 @@ * so that we will pick up the blank line the next time 'round. */ -while (c != EOF && c != '\n' && ap_isspace(c)) { -ap_getc(map, &c); +while (c != '\n' && ap_isspace(c)) { +if(ap_getc(map, &c) != APR_SUCCESS) + break; } ap_ungetc(map, c);
cvs commit: apache-2.0/src/lib/apr/file_io/unix open.c
ben 99/09/11 13:42:58 Modified:src/lib/apr/file_io/unix open.c Log: Test for open failure correctly. Revision ChangesPath 1.8 +1 -1 apache-2.0/src/lib/apr/file_io/unix/open.c Index: open.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- open.c1999/09/07 21:24:37 1.7 +++ open.c1999/09/11 20:42:58 1.8 @@ -168,7 +168,7 @@ } } -if ((*new)->filedes < 0 && (*new)->filehand == NULL) { +if ((*new)->filedes < 0 || (*new)->filehand == NULL) { (*new)->filedes = -1; (*new)->eof_hit = 1; return errno;
cvs commit: apache-2.0/src Makefile.tmpl
ben 99/09/11 13:42:24 Modified:src Makefile.tmpl Log: Build APR automatically. Revision ChangesPath 1.7 +4 -1 apache-2.0/src/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/src/Makefile.tmpl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Makefile.tmpl 1999/09/10 16:06:53 1.6 +++ Makefile.tmpl 1999/09/11 20:42:19 1.7 @@ -28,7 +28,10 @@ @echo "++ If not, you will at least have to touch '@@Configuration@@'." @false -$(TARGET): $(EXTRA_DEPS) $(SUBTARGET) +apr: + cd lib/apr; make + +$(TARGET): apr $(EXTRA_DEPS) $(SUBTARGET) target_static: subdirs modules.o $(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c
cvs commit: apache-2.0/src/main http_main.c
ben 99/09/11 12:52:28 Modified:src/main http_main.c Log: Really get rid of unused options. Revision ChangesPath 1.6 +1 -1 apache-2.0/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-2.0/src/main/http_main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- http_main.c 1999/08/31 05:32:58 1.5 +++ http_main.c 1999/09/11 19:52:27 1.6 @@ -277,7 +277,7 @@ ap_setup_prelinked_modules(); -while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:th")) != -1) { +while ((c = getopt(argc, argv, "C:c:d:f:vVlLth")) != -1) { char **new; switch (c) { case 'c':
Re: cvs commit: apache-2.0/src/modules/mpm/mpmt_pthread acceptlock.c scoreboard.c
[EMAIL PROTECTED] wrote: > -lock_fd[i] = ap_popenf(p, lock_fname, O_WRONLY, 0600); > +ap_open(p, lock_fname, APR_WRITE, APR_UREAD | APR_UWRITE, > &tempfile); > +ap_get_os_file(tempfile, *lock_fd[i]); Que? *lock_fd[i]? Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/src/modules/mpm/prefork prefork.c
ben 99/09/11 03:26:00 Modified:src/modules/mpm/prefork prefork.c Log: Make prefork compile on FreeBSD. Revision ChangesPath 1.34 +13 -5 apache-2.0/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- prefork.c 1999/09/08 14:15:49 1.33 +++ prefork.c 1999/09/11 10:25:59 1.34 @@ -590,9 +590,11 @@ static int lock_fd = -1; -static void accept_mutex_cleanup(void *foo) +static ap_status_t accept_mutex_cleanup(void *foo) { unlink(ap_lock_fname); + +return APR_SUCCESS; } /* @@ -601,13 +603,15 @@ */ static void accept_mutex_child_init(ap_context_t *p) { +ap_file_t *tempfile; -lock_fd = ap_popenf(p, ap_lock_fname, O_WRONLY, 0600); -if (lock_fd == -1) { +ap_open(p, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE, &tempfile); +if (!tempfile) { ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "Child cannot open lock file: %s", ap_lock_fname); clean_child_exit(APEXIT_CHILDINIT); } +ap_get_os_file(tempfile, &lock_fd); } /* @@ -616,14 +620,18 @@ */ static void accept_mutex_init(ap_context_t *p) { +ap_file_t *tempfile; + expand_lock_fname(p); unlink(ap_lock_fname); -lock_fd = ap_popenf(p, ap_lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0600); -if (lock_fd == -1) { +ap_open(p, ap_lock_fname, APR_CREATE|APR_WRITE|APR_EXCL, + APR_UREAD|APR_UWRITE, &tempfile); +if (!tempfile) { ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "Parent cannot open lock file: %s", ap_lock_fname); exit(APEXIT_INIT); } +ap_get_os_file(tempfile, &lock_fd); ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup); }
cvs commit: apache-2.0/src/os/unix Makefile.tmpl
ben 99/09/10 07:34:49 Modified:src Makefile.tmpl src/ap Makefile.tmpl src/main Makefile.tmpl src/modules/mpm/prefork Makefile.tmpl src/modules/standard Makefile.tmpl src/os/unix Makefile.tmpl Log: Update dependencies. Revision ChangesPath 1.5 +11 -12apache-2.0/src/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/src/Makefile.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.tmpl 1999/09/01 14:38:34 1.4 +++ Makefile.tmpl 1999/09/10 14:34:39 1.5 @@ -123,17 +123,16 @@ # DO NOT REMOVE buildmark.o: buildmark.c include/ap_config.h include/ap_mmn.h \ include/ap_config_auto.h os/unix/os.h os/unix/os-inline.c \ - include/ap_ctype.h include/hsregex.h include/httpd.h \ - lib/apr/include/apr_general.h lib/apr/include/apr_config.h \ - lib/apr/include/apr_errno.h lib/apr/include/apr_lib.h \ - lib/apr/include/apr_file_io.h lib/apr/include/hsregex.h \ - include/buff.h include/ap_iol.h include/ap.h include/apr.h \ - include/util_uri.h + include/ap_ctype.h include/httpd.h lib/apr/include/apr_general.h \ + lib/apr/include/apr_config.h lib/apr/include/apr_errno.h \ + lib/apr/include/apr_lib.h lib/apr/include/apr_file_io.h \ + lib/apr/include/hsregex.h include/buff.h include/ap_iol.h \ + include/ap.h include/apr.h include/util_uri.h modules.o: modules.c include/httpd.h include/ap_config.h \ include/ap_mmn.h include/ap_config_auto.h os/unix/os.h \ - os/unix/os-inline.c include/ap_ctype.h include/hsregex.h \ - lib/apr/include/apr_general.h lib/apr/include/apr_config.h \ - lib/apr/include/apr_errno.h lib/apr/include/apr_lib.h \ - lib/apr/include/apr_file_io.h lib/apr/include/hsregex.h \ - include/buff.h include/ap_iol.h include/ap.h include/apr.h \ - include/util_uri.h include/http_config.h include/ap_hooks.h + os/unix/os-inline.c include/ap_ctype.h lib/apr/include/apr_general.h \ + lib/apr/include/apr_config.h lib/apr/include/apr_errno.h \ + lib/apr/include/apr_lib.h lib/apr/include/apr_file_io.h \ + lib/apr/include/hsregex.h include/buff.h include/ap_iol.h \ + include/ap.h include/apr.h include/util_uri.h include/http_config.h \ + include/ap_hooks.h 1.5 +15 -18apache-2.0/src/ap/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/src/ap/Makefile.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.tmpl 1999/09/01 14:38:36 1.4 +++ Makefile.tmpl 1999/09/10 14:34:41 1.5 @@ -40,17 +40,15 @@ # DO NOT REMOVE ap_base64.o: ap_base64.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap.h \ - $(INCDIR)/apr.h + $(INCDIR)/ap_ctype.h $(INCDIR)/ap.h $(INCDIR)/apr.h ap_buf.o: ap_buf.c ap_checkpass.o: ap_checkpass.c $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ - $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ - $(INCDIR)/ap_md5.h $(INCDIR)/ap_sha1.h $(INCDIR)/ap.h \ - $(INCDIR)/apr.h + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/ap_md5.h \ + $(INCDIR)/ap_sha1.h $(INCDIR)/ap.h $(INCDIR)/apr.h ap_cpystrn.o: ap_cpystrn.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ - $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ ../lib/apr/include/apr_general.h ../lib/apr/include/apr_config.h \ ../lib/apr/include/apr_errno.h ../lib/apr/include/apr_lib.h \ ../lib/apr/include/apr_file_io.h ../lib/apr/include/hsregex.h \ @@ -58,7 +56,7 @@ $(INCDIR)/apr.h $(INCDIR)/util_uri.h ap_execve.o: ap_execve.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ - $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ ../lib/apr/include/apr_general.h ../lib/apr/include/apr_config.h \ ../lib/apr/include/apr_errno.h ../lib/apr/include/apr_lib.h \ ../lib/apr/include/apr_file_io.h ../lib/apr/include/hsregex.h \ @@ -66,14 +64,13 @@ $(INCDIR)/apr.h $(INCDIR)/util_uri.h ap_fnmatch.o: ap_fnmatch.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/fnmatch.h + $(INCDIR)/ap_ctype.h $(INCDIR)/fnmatch.h ap_getpass.o: ap_getpass.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ - $(INCDIR
cvs commit: apache-2.0/mpm/src/lib/apr/network_io/unix poll.c
ben 99/08/18 08:54:19 Modified:mpm/src/lib/apr config.status mpm/src/lib/apr/include apr_config.h mpm/src/lib/apr/network_io/unix poll.c Log: Use sys/time.h to get timeval. Correct typo. Revision ChangesPath 1.3 +57 -95apache-2.0/mpm/src/lib/apr/Attic/config.status 1.3 +13 -10apache-2.0/mpm/src/lib/apr/include/Attic/apr_config.h 1.3 +6 -3 apache-2.0/mpm/src/lib/apr/network_io/unix/poll.c Index: poll.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/lib/apr/network_io/unix/poll.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- poll.c1999/08/18 13:33:28 1.2 +++ poll.c1999/08/18 15:54:18 1.3 @@ -60,6 +60,9 @@ #ifdef HAVE_ERRNO_H #include #endif +#ifdef HAVE_SYS_TIME_H +#include +#endif #ifdef HAVE_POLL/* We can just use poll to do our socket polling. */ @@ -396,13 +399,13 @@ ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, struct socket_t *sock, ap_int16_t events) { -if (event & APR_POLLIN) { +if (events & APR_POLLIN) { FD_CLR(sock->socketdes, aprset->read); } -if (event & APR_POLLPRI) { +if (events & APR_POLLPRI) { FD_CLR(sock->socketdes, aprset->read); } -if (event & APR_POLLOUT) { +if (events & APR_POLLOUT) { FD_CLR(sock->socketdes, aprset->write); } return APR_SUCCESS;
cvs commit: apache-2.0 emacs-style
ben 99/08/15 14:55:19 Modified:.emacs-style Log: Get case indent right. Revision ChangesPath 1.2 +1 -0 apache-2.0/emacs-style Index: emacs-style === RCS file: /export/home/cvs/apache-2.0/emacs-style,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- emacs-style 1999/08/01 15:20:53 1.1 +++ emacs-style 1999/08/15 21:55:19 1.2 @@ -5,5 +5,6 @@ (c-set-offset 'statement-block-intro' ++) (c-set-offset 'substatement' ++) (c-set-offset 'brace-list-intro' ++) + (c-set-offset 'statement-case-intro' ++) ))) (setq c++-mode-hook c-mode-hook)
cvs commit: apache-2.0/mpm/htdocs hooks.html
ben 99/08/15 06:50:27 Added: mpm/htdocs hooks.html Log: First-cut docco for hook functions. Revision ChangesPath 1.1 apache-2.0/mpm/htdocs/hooks.html Index: hooks.html === Apache Hook Functions In general, a hook function is one that Apache will call at some point during the processing of a request. Modules can provide functions that are called, and specify when they get called in comparison to other modules. Creating a hook function In order to create a new hook, four things need to be done: Declare the hook function Use the DECLARE_HOOK macro, which needs to be given the name of the hook, the return type of the hook function and the arguments. For example, if the hook returns an int and takes a request_rec * and an int and is called "do_something", then declare it like this: DECLARE_HOOK(int,do_something,(request_rec *r,int n)) This should go in a header which modules will include if they want to use the hook. Create the hook structure Each source file that exports a hook has a private structure which is used to record the module functions that use the hook. This is declared as follows: HOOK_STRUCT( HOOK_LINK(do_something) ... ) Implement the hook caller The source file that exports the hook has to implement a function that will call the hook. There are currently three possible ways to do this. In all cases, the calling function is called ap_run_hookname(). Void hooks If the return value of a hook is void, then all the hooks are called, and the caller is implemented like this: IMPLEMENT_HOOK_VOID(do_something,(request_rec *r,int n),(r,n)) The second and third arguments are the dummy argument declaration and the dummy arguments as they will be used when calling the hook. In other words, this macro expands to something like this: void ap_run_do_something(request_rec *r,int n) { ... do_something(r,n); } Hooks that return a value If the hook returns a value, then it can either be run until the first hook that does something interesting, like so: IMPLEMENT_HOOK_RUN_FIRST(int,do_something,(request_rec *r,int n),(r,n),DECLINED) The first hook that doesn't return DECLINED stops the loop and its return value is returned from the hook caller. Note that DECLINED is the tradition Apache hook return meaning "I didn't do anything", but it can be whatever suits you. Alternatively, all hooks can be run until an error occurs. This boils down to permitting two return values, one of which means "I did something, and it was OK" and the other meaning "I did nothing". The first function that returns a value other than one of those two stops the loop, and its return is the return value. Declare these like so: IMPLEMENT_HOOK_RUN_ALL(int,do_something,(request_rec *r,int n),(r,n),OK,DECLINED) Again, OK and DECLINED are the traditional values. You can use what you want. Call the hook callers At appropriate moments in the code, call the hook caller, like so: int n,ret; request_rec *r; ret=ap_run_do_something(r,n); Hooking the hook A module that wants a hook to be called needs to do two things. Implement the hook function Include the appropriate header, and define a static function of the correct type: static int my_something_doer(request_rec *r,int n) { ... return OK; } Add a hook registering function During initialisation, Apache will call each modules hook registering function, which is included in the module structure: static void my_register_hooks() { ap_hook_do_something(my_something_doer,NULL,NULL,HOOK_MIDDLE); } mode MODULE_VAR_EXPORT my_module = { ... my_register_hooks /* register hooks */ }; Controlling hook calling order In the example above, we didn't use the three arguments in the hook registration function that control calling order. There are two mechanisms for doing this. The first, rather crude, method, allows us to specify roughly where the hook is run relative to other modules. The final argument control this. There are three possible values: HOOK_FIRST HOOK_MIDDLE HOOK_LAST All modules using any particular value may be run in any order relative to each other, but, of course, all modules using HOOK_FIRST will be run before HOOK_MIDDLE which are before HOOK_LAST. Modules that don't care when they are run should use HOOK_MIDDLE. (I spaced these out so people could do stuff like HOOK_FIRST-2 to get in slightly earlier, but is this wise? - Ben) Note that there are two more values, HOOK_RE
cvs commit: apache-2.0/mpm/src/modules/standard mod_alias.c mod_auth.c mod_echo.c mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/08/14 17:15:47 Modified:mpm/src/main http_core.c mpm/src/modules/standard mod_alias.c mod_auth.c mod_echo.c mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Fix formatting. Revision ChangesPath 1.21 +2 -2 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- http_core.c 1999/08/15 00:11:12 1.20 +++ http_core.c 1999/08/15 00:15:43 1.21 @@ -2661,7 +2661,7 @@ { return DEFAULT_HTTP_PORT; } static void register_hooks() -{ +{ ap_hook_translate_name(core_translate,NULL,NULL,HOOK_REALLY_LAST); ap_hook_process_connection(ap_process_http_connection,NULL,NULL, HOOK_REALLY_LAST); @@ -2671,7 +2671,7 @@ /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); ap_hook_access_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); -} +} API_VAR_EXPORT module core_module = { STANDARD20_MODULE_STUFF, 1.17 +2 -2 apache-2.0/mpm/src/modules/standard/mod_alias.c Index: mod_alias.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_alias.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- mod_alias.c 1999/08/15 00:11:15 1.16 +++ mod_alias.c 1999/08/15 00:15:43 1.17 @@ -396,12 +396,12 @@ } static void register_hooks() -{ +{ static const char * const aszPre[]={ "mod_userdir.c",NULL }; ap_hook_translate_name(translate_alias_redir,aszPre,NULL,HOOK_MIDDLE); ap_hook_fixups(fixup_redir,NULL,NULL,HOOK_MIDDLE); -} +} module MODULE_VAR_EXPORT alias_module = { 1.17 +2 -2 apache-2.0/mpm/src/modules/standard/mod_auth.c Index: mod_auth.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_auth.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- mod_auth.c1999/08/15 00:11:18 1.16 +++ mod_auth.c1999/08/15 00:15:44 1.17 @@ -310,10 +310,10 @@ } static void register_hooks(void) -{ +{ ap_hook_check_user_id(authenticate_basic_user,NULL,NULL,HOOK_MIDDLE); ap_hook_auth_checker(check_user_access,NULL,NULL,HOOK_MIDDLE); -} +} module MODULE_VAR_EXPORT auth_module = { 1.10 +2 -2 apache-2.0/mpm/src/modules/standard/mod_echo.c Index: mod_echo.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_echo.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_echo.c1999/08/15 00:11:18 1.9 +++ mod_echo.c1999/08/15 00:15:44 1.10 @@ -57,9 +57,9 @@ }; static void register_hooks() -{ +{ ap_hook_process_connection(process_echo_connection,NULL,NULL,HOOK_MIDDLE); -} +} API_VAR_EXPORT module echo_module = { STANDARD20_MODULE_STUFF, 1.17 +2 -2 apache-2.0/mpm/src/modules/standard/mod_env.c Index: mod_env.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_env.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- mod_env.c 1999/08/15 00:11:18 1.16 +++ mod_env.c 1999/08/15 00:15:44 1.17 @@ -248,9 +248,9 @@ } static void register_hooks() -{ +{ ap_hook_fixups(fixup_env_module,NULL,NULL,HOOK_MIDDLE); -} +} module MODULE_VAR_EXPORT env_module = 1.17 +2 -2 apache-2.0/mpm/src/modules/standard/mod_log_config.c Index: mod_log_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_log_config.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- mod_log_config.c 1999/08/15 00:11:19 1.16 +++ mod_log_config.c 1999/08/15 00:15:44 1.17 @@ -1115,10 +1115,10 @@ #endif static void register_hooks() -{ +{ ap_hook_open_logs(init_config_log,NULL,NULL,HOOK_MIDDLE); ap_hook_log_transaction(multi_log_transaction,NULL,NULL,HOOK_MIDDLE); -} +} module MODULE_VAR_EXPORT config_log_module = { 1.15 +2 -2 apache-2.0/mpm/s
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/08/14 17:11:23 Modified:mpm/src/include http_config.h mpm/src/main http_config.c http_core.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Child initializer hook. Revision ChangesPath 1.17 +1 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- http_config.h 1999/08/15 00:01:15 1.16 +++ http_config.h 1999/08/15 00:11:11 1.17 @@ -211,8 +211,6 @@ * (see also mod_so). */ -void (*child_init)(pool *pchild, server_rec *); - void *(*create_dir_config) (pool *p, char *dir); void *(*merge_dir_config) (pool *p, void *base_conf, void *new_conf); void *(*create_server_config) (pool *p, server_rec *s); @@ -373,6 +371,7 @@ (pool *pconf,pool *plog,pool *ptemp,server_rec *s)) DECLARE_HOOK(void,open_logs, (pool *pconf,pool *plog,pool *ptemp,server_rec *s)) +DECLARE_HOOK(void,child_init,(pool *pchild, server_rec *s)) #ifdef __cplusplus } 1.22 +3 -5 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- http_config.c 1999/08/15 00:03:53 1.21 +++ http_config.c 1999/08/15 00:11:11 1.22 @@ -86,6 +86,7 @@ HOOK_LINK(pre_config) HOOK_LINK(post_config) HOOK_LINK(open_logs) + HOOK_LINK(child_init) ) IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED) @@ -97,6 +98,7 @@ IMPLEMENT_HOOK_VOID(open_logs, (pool *pconf, pool *plog, pool *ptemp, server_rec *s), (pconf,plog,ptemp,s)) +IMPLEMENT_HOOK_VOID(child_init,(pool *pchild, server_rec *s),(pchild,s)) DEF_Explain @@ -1312,14 +1314,10 @@ void ap_child_init_hook(pool *pchild, server_rec *s) { -module *m; - /* TODO: uh this seems ugly, is there a better way? */ ap_child_init_alloc(); -for (m = top_module; m; m = m->next) - if (m->child_init) - (*m->child_init) (pchild, s); +ap_run_child_init(pchild,s); } / 1.20 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- http_core.c 1999/08/15 00:01:18 1.19 +++ http_core.c 1999/08/15 00:11:12 1.20 @@ -2675,7 +2675,6 @@ API_VAR_EXPORT module core_module = { STANDARD20_MODULE_STUFF, -NULL,/* child_init */ create_core_dir_config, /* create per-directory config structure */ merge_core_dir_configs, /* merge per-directory config structures */ create_core_server_config, /* create per-server config structure */ 1.30 +0 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- prefork.c 1999/08/15 00:01:23 1.29 +++ prefork.c 1999/08/15 00:11:13 1.30 @@ -2977,7 +2977,6 @@ module MODULE_VAR_EXPORT mpm_prefork_module = { STANDARD20_MODULE_STUFF, -NULL,/* child_init */ NULL,/* create per-directory config structure */ NULL,/* merge per-directory config structures */ NULL,/* create per-server config structure */ 1.15 +0 -1 apache-2.0/mpm/src/modules/standard/mod_access.c Index: mod_access.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_access.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_access.c 1999/08
cvs commit: apache-2.0/mpm/src/main http_config.c
ben 99/08/14 17:03:53 Modified:mpm/src/main http_config.c Log: Remove code that is now dead as a result of hooks. Revision ChangesPath 1.21 +0 -104apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- http_config.c 1999/08/15 00:01:17 1.20 +++ http_config.c 1999/08/15 00:03:53 1.21 @@ -241,109 +241,6 @@ return create_empty_config(p); } -#ifdef EXPLAIN - -struct { -int offset; -char *method; -} aMethods[] = - -{ -#define m(meth) { XtOffsetOf(module,meth),#meth } -{ -1, "?" }, -#undef m -}; - -char *ShowMethod(module *modp, int offset) -{ -int n; -static char buf[200]; - -for (n = 0; aMethods[n].offset >= 0; ++n) - if (aMethods[n].offset == offset) - break; -ap_snprintf(buf, sizeof(buf), "%s:%s", modp->name, aMethods[n].method); -return buf; -} -#else -#define ShowMethod(modp,offset) -#endif - -/ - * - * Dispatch through the modules to find handlers for various phases - * of request handling. These are invoked by http_request.c to actually - * do the dirty work of slogging through the module structures. - */ - -/* - * Optimized run_method routines. The observation here is that many modules - * have NULL for most of the methods. So we build optimized lists of - * everything. If you think about it, this is really just like a sparse array - * implementation to avoid scanning the zero entries. - */ -static const int method_offsets[] = -{ -}; -#define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) - -static struct { -} offsets_into_method_ptrs; - -/* - * This is just one big array of method_ptrs. It's constructed such that, - * for example, method_ptrs[ offsets_into_method_ptrs.logger ] is the first - * 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. - * XXX: this breaks if modules dink with their methods pointers - */ -static void build_method_shortcuts(void) -{ -module *modp; -int how_many_ptrs; -int i; -int next_ptr; -handler_func fp; - -if (method_ptrs) { - /* free up any previous set of method_ptrs */ - free(method_ptrs); -} - -/* first we count how many functions we have */ -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)); -if (method_ptrs == NULL) { - fprintf(stderr, "Ouch! Out of memory in build_method_shortcuts()!\n"); -} -next_ptr = 0; -for (i = 0; i < NMETHODS; ++i) { - /* XXX: This is an itsy bit presumptuous about the alignment - * constraints on offsets_into_method_ptrs. I can't remember if - * 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; - } - } - method_ptrs[next_ptr++] = NULL; -} -} - /* * For speed/efficiency we generate a compact list of all the handlers * and wildcard handlers. This means we won't have to scan the entire @@ -1410,7 +1307,6 @@ void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s) { ap_run_post_config(pconf,plog,ptemp,s); -build_method_shortcuts(); init_handlers(pconf); }
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/08/14 17:01:31 Modified:mpm/src/include http_config.h http_request.h mpm/src/main http_config.c http_core.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Auth checker hook Revision ChangesPath 1.16 +0 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- http_config.h 1999/08/14 23:46:37 1.15 +++ http_config.h 1999/08/15 00:01:15 1.16 @@ -235,7 +235,6 @@ * sets content_type, _encoding and _language fields. */ -int (*auth_checker) (request_rec *); void (*register_hooks) (void); } module; @@ -356,7 +355,6 @@ int ap_translate_name(request_rec *); int ap_check_user_id(request_rec *); /* obtain valid username from client auth */ -int ap_check_auth(request_rec *);/* check (validated) user is authorized here */ int ap_invoke_handler(request_rec *); /* for mod_perl */ 1.7 +1 -0 apache-2.0/mpm/src/include/http_request.h Index: http_request.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_request.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- http_request.h1999/08/14 23:46:38 1.6 +++ http_request.h1999/08/15 00:01:16 1.7 @@ -118,6 +118,7 @@ DECLARE_HOOK(int,fixups,(request_rec *)) DECLARE_HOOK(int,type_checker,(request_rec *)) DECLARE_HOOK(int,access_checker,(request_rec *)) +DECLARE_HOOK(int,auth_checker,(request_rec *)) #ifdef __cplusplus } 1.20 +0 -34 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- http_config.c 1999/08/14 23:46:39 1.19 +++ http_config.c 1999/08/15 00:01:17 1.20 @@ -250,7 +250,6 @@ { #define m(meth) { XtOffsetOf(module,meth),#meth } -m(auth_checker), { -1, "?" }, #undef m }; @@ -285,12 +284,10 @@ */ static const int method_offsets[] = { -XtOffsetOf(module, auth_checker), }; #define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) static struct { -int auth_checker; } offsets_into_method_ptrs; /* @@ -345,37 +342,6 @@ } method_ptrs[next_ptr++] = NULL; } -} - - -static int run_method(request_rec *r, int offset, int run_all) -{ -int i; - -for (i = offset; method_ptrs[i]; ++i) { - handler_func mod_handler = method_ptrs[i]; - - if (mod_handler) { - int result; - - result = (*mod_handler) (r); - - if (result != DECLINED && (!run_all || result != OK)) - return result; - } -} - -return run_all ? OK : DECLINED; -} - -/* Auth stuff --- anything that defines one of these will presumably - * want to define something for the other. Note that check_auth is - * separate from check_access to make catching some config errors easier. - */ - -int ap_check_auth(request_rec *r) -{ -return run_method(r, offsets_into_method_ptrs.auth_checker, 0); } /* 1.19 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- http_core.c 1999/08/14 23:46:40 1.18 +++ http_core.c 1999/08/15 00:01:18 1.19 @@ -2682,6 +2682,5 @@ merge_core_server_configs, /* merge per-server config structures */ core_cmds, /* command table */ core_handlers, /* handlers */ -NULL,/* check auth */ register_hooks /* register hooks */ }; 1.17 +8 -6 apache-2.0/mpm/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving revision
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/08/14 16:46:50 Modified:mpm/src/include http_config.h http_request.h mpm/src/main http_config.c http_core.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Access checker hook. Revision ChangesPath 1.15 +0 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- http_config.h 1999/08/01 14:43:22 1.14 +++ http_config.h 1999/08/14 23:46:37 1.15 @@ -236,7 +236,6 @@ */ int (*auth_checker) (request_rec *); -int (*access_checker) (request_rec *); void (*register_hooks) (void); } module; @@ -356,7 +355,6 @@ /* Module-method dispatchers, also for http_request.c */ int ap_translate_name(request_rec *); -int ap_check_access(request_rec *); /* check access on non-auth basis */ int ap_check_user_id(request_rec *); /* obtain valid username from client auth */ int ap_check_auth(request_rec *);/* check (validated) user is authorized here */ int ap_invoke_handler(request_rec *); 1.6 +1 -0 apache-2.0/mpm/src/include/http_request.h Index: http_request.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_request.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- http_request.h1999/07/24 18:38:38 1.5 +++ http_request.h1999/08/14 23:46:38 1.6 @@ -117,6 +117,7 @@ DECLARE_HOOK(int,check_user_id,(request_rec *)) DECLARE_HOOK(int,fixups,(request_rec *)) DECLARE_HOOK(int,type_checker,(request_rec *)) +DECLARE_HOOK(int,access_checker,(request_rec *)) #ifdef __cplusplus } 1.19 +0 -7 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- http_config.c 1999/08/01 14:43:23 1.18 +++ http_config.c 1999/08/14 23:46:39 1.19 @@ -286,13 +286,11 @@ static const int method_offsets[] = { XtOffsetOf(module, auth_checker), -XtOffsetOf(module, access_checker), }; #define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) static struct { int auth_checker; -int access_checker; } offsets_into_method_ptrs; /* @@ -368,11 +366,6 @@ } return run_all ? OK : DECLINED; -} - -int ap_check_access(request_rec *r) -{ -return run_method(r, offsets_into_method_ptrs.access_checker, 1); } /* Auth stuff --- anything that defines one of these will presumably 1.18 +1 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- http_core.c 1999/08/06 00:54:30 1.17 +++ http_core.c 1999/08/14 23:46:40 1.18 @@ -2670,6 +2670,7 @@ ap_hook_open_logs(core_open_logs,NULL,NULL,HOOK_MIDDLE); /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); +ap_hook_access_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); } API_VAR_EXPORT module core_module = { @@ -2682,6 +2683,5 @@ core_cmds, /* command table */ core_handlers, /* handlers */ NULL,/* check auth */ -do_nothing, /* check access */ register_hooks /* register hooks */ }; 1.16 +8 -6 apache-2.0/mpm/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- http_request.c1999/07/31 09:31:23 1.15 +++ http_request.c1999/08/14 23:46:40 1.16 @@ -83,12 +83,14 @@ HOOK_LINK(check_user_id) HOOK_LINK(fixups) HOOK_LINK(type_checker) + HOOK_LINK(access_checker
cvs commit: apache-2.0/mpm/src/ap ap_hooks.c
ben 99/08/01 13:26:31 Modified:mpm/src/ap ap_hooks.c Log: Reformat according to style guide. Revision ChangesPath 1.4 +54 -65apache-2.0/mpm/src/ap/ap_hooks.c Index: ap_hooks.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/ap_hooks.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ap_hooks.c1999/07/19 06:50:10 1.3 +++ ap_hooks.c1999/08/01 20:26:31 1.4 @@ -8,53 +8,51 @@ /* NB: This must echo the LINK_##name structure */ typedef struct -{ +{ void (*dummy)(void *); const char *szName; const char * const *aszPredecessors; const char * const *aszSuccessors; int nOrder; -} TSortData; +} TSortData; typedef struct tsort_ -{ +{ void *pData; int nPredecessors; struct tsort_ **ppPredecessors; struct tsort_ *pNext; -} TSort; +} TSort; static int crude_order(const void *a_,const void *b_) -{ +{ const TSortData *a=a_; const TSortData *b=b_; return a->nOrder-b->nOrder; -} +} static TSort *prepare(pool *p,TSortData *pItems,int nItems) -{ +{ TSort *pData=ap_palloc(p,nItems*sizeof *pData); int n; - + qsort(pItems,nItems,sizeof *pItems,crude_order); -for(n=0 ; n < nItems ; ++n) - { +for(n=0 ; n < nItems ; ++n) { pData[n].nPredecessors=0; pData[n].ppPredecessors=ap_palloc(p,nItems*sizeof *pData[n].ppPredecessors); pData[n].pNext=NULL; pData[n].pData=&pItems[n]; - } +} -for(n=0 ; n < nItems ; ++n) - { +for(n=0 ; n < nItems ; ++n) { int i,k; for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) - { + if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { int l; + for(l=0 ; l < pData[n].nPredecessors ; ++l) if(pData[n].ppPredecessors[l] == &pData[k]) goto got_it; @@ -62,12 +60,12 @@ ++pData[n].nPredecessors; got_it: break; - } + } for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) - { + if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { int l; + for(l=0 ; l < pData[k].nPredecessors ; ++l) if(pData[k].ppPredecessors[l] == &pData[n]) goto got_it2; @@ -75,29 +73,27 @@ ++pData[k].nPredecessors; got_it2: break; - } - } + } +} return pData; -} +} static TSort *tsort(TSort *pData,int nItems) -{ +{ int nTotal; TSort *pHead=NULL; TSort *pTail=NULL; -for(nTotal=0 ; nTotal < nItems ; ++nTotal) - { +for(nTotal=0 ; nTotal < nItems ; ++nTotal) { int n,i,k; - for(n=0 ; ; ++n) - { + for(n=0 ; ; ++n) { if(n == nItems) assert(0); /* // we have a loop... */ if(!pData[n].pNext && !pData[n].nPredecessors) break; - } + } if(pTail) pTail->pNext=&pData[n]; else @@ -106,18 +102,17 @@ pTail->pNext=pTail; /* // fudge it so it looks linked */ for(i=0 ; i < nItems ; ++i) for(k=0 ; pData[i].ppPredecessors[k] ; ++k) - if(pData[i].ppPredecessors[k] == &pData[n]) - { + if(pData[i].ppPredecessors[k] == &pData[n]) { --pData[i].nPredecessors; break; - } - } + } +} pTail->pNext=NULL; /* // unfudge the tail */ return pHead; -} +} static array_header *sort_hook(array_header *pHooks,const char *szName) -{ +{ pool *p=ap_make_sub_pool(g_pHookPool); TSort *pSort; array_header *pNew; @@ -128,29 +123,28 @@ pNew=ap_make_array(g_pHookPool,pHooks->nelts,sizeof(TSortData)); if(g_bDebugHooks) printf("Sorting %s:",szName); -for(n=0 ; pSort ; pSort=pSort->pNext,++n) - { +for(n=0 ; pSort ; pSort=pSort->pNext,++n) { TSortData *pHook; assert(n < pHooks->nelts);
cvs commit: apache-2.0 emacs-style
ben 99/08/01 08:20:53 Added: .emacs-style Log: Set up emacs for the Apache Style Guide. Revision ChangesPath 1.1 apache-2.0/emacs-style Index: emacs-style === (add-hook 'c-mode-hook (function (lambda () (c-set-offset 'inclass' ++) (c-set-offset 'defun-block-intro' ++) (c-set-offset 'statement-block-intro' ++) (c-set-offset 'substatement' ++) (c-set-offset 'brace-list-intro' ++) ))) (setq c++-mode-hook c-mode-hook)
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/08/01 07:43:32 Modified:mpm/src/include http_config.h mpm/src/main http_config.c http_core.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision ChangesPath 1.14 +3 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- http_config.h 1999/08/01 14:12:29 1.13 +++ http_config.h 1999/08/01 14:43:22 1.14 @@ -211,7 +211,6 @@ * (see also mod_so). */ -void (*post_config)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*child_init)(pool *pchild, server_rec *); void *(*create_dir_config) (pool *p, char *dir); @@ -374,8 +373,10 @@ /* Hooks */ DECLARE_HOOK(int,header_parser,(request_rec *)) DECLARE_HOOK(void,pre_config,(pool *pconf,pool *plog,pool *ptemp)) +DECLARE_HOOK(void,post_config, + (pool *pconf,pool *plog,pool *ptemp,server_rec *s)) DECLARE_HOOK(void,open_logs, - (pool *pconf, pool *plog, pool *ptemp, server_rec *s)) + (pool *pconf,pool *plog,pool *ptemp,server_rec *s)) #ifdef __cplusplus } 1.18 +5 -5 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- http_config.c 1999/08/01 14:12:30 1.17 +++ http_config.c 1999/08/01 14:43:23 1.18 @@ -84,12 +84,16 @@ HOOK_STRUCT( HOOK_LINK(header_parser) HOOK_LINK(pre_config) + HOOK_LINK(post_config) HOOK_LINK(open_logs) ) IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED) IMPLEMENT_HOOK_VOID(pre_config,(pool *pconf,pool *plog,pool *ptemp), (pconf,plog,ptemp)) +IMPLEMENT_HOOK_VOID(post_config, + (pool *pconf, pool *plog, pool *ptemp, server_rec *s), + (pconf,plog,ptemp,s)) IMPLEMENT_HOOK_VOID(open_logs, (pool *pconf, pool *plog, pool *ptemp, server_rec *s), (pconf,plog,ptemp,s)) @@ -1446,11 +1450,7 @@ void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s) { -module *m; - -for (m = top_module; m; m = m->next) - if (m->post_config) - (*m->post_config) (pconf, plog, ptemp, s); +ap_run_post_config(pconf,plog,ptemp,s); build_method_shortcuts(); init_handlers(pconf); } 1.15 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- http_core.c 1999/08/01 14:12:30 1.14 +++ http_core.c 1999/08/01 14:43:23 1.15 @@ -2650,7 +2650,6 @@ API_VAR_EXPORT module core_module = { STANDARD20_MODULE_STUFF, -NULL,/* post_config */ NULL,/* child_init */ create_core_dir_config, /* create per-directory config structure */ merge_core_dir_configs, /* merge per-directory config structures */ 1.23 +0 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- prefork.c 1999/08/01 14:12:31 1.22 +++ prefork.c 1999/08/01 14:43:24 1.23 @@ -3084,7 +3084,6 @@ module MODULE_VAR_EXPORT mpm_prefork_module = { STANDARD20_MODULE_STUFF, -NULL,/* post_config */ NULL,/* child_init */ NULL,/* create per-directory config structure */ NULL,/* merge per-directory config structures */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_access.c Index: mod_access.c === RCS file: /export/home/cvs/a
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/08/01 07:12:37 Modified:mpm/src/include http_config.h mpm/src/main http_config.c http_core.c http_main.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision ChangesPath 1.13 +4 -4 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- http_config.h 1999/07/27 21:16:36 1.12 +++ http_config.h 1999/08/01 14:12:29 1.13 @@ -211,7 +211,6 @@ * (see also mod_so). */ -void (*open_logs)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*post_config)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*child_init)(pool *pchild, server_rec *); @@ -333,7 +332,6 @@ void ap_show_directives(void); void ap_show_modules(void); server_rec *ap_read_config(pool *conf_pool, pool *temp_pool, const char *config_name); -void ap_open_logs_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s); void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s); void ap_child_init_hook(pool *pchild, server_rec *s); @@ -371,11 +369,13 @@ CORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *config, module *mod); CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l); +#endif + /* Hooks */ DECLARE_HOOK(int,header_parser,(request_rec *)) DECLARE_HOOK(void,pre_config,(pool *pconf,pool *plog,pool *ptemp)) - -#endif +DECLARE_HOOK(void,open_logs, + (pool *pconf, pool *plog, pool *ptemp, server_rec *s)) #ifdef __cplusplus } 1.17 +4 -9 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- http_config.c 1999/07/31 09:31:20 1.16 +++ http_config.c 1999/08/01 14:12:30 1.17 @@ -84,11 +84,15 @@ HOOK_STRUCT( HOOK_LINK(header_parser) HOOK_LINK(pre_config) + HOOK_LINK(open_logs) ) IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED) IMPLEMENT_HOOK_VOID(pre_config,(pool *pconf,pool *plog,pool *ptemp), (pconf,plog,ptemp)) +IMPLEMENT_HOOK_VOID(open_logs, + (pool *pconf, pool *plog, pool *ptemp, server_rec *s), + (pconf,plog,ptemp,s)) DEF_Explain @@ -1449,15 +1453,6 @@ (*m->post_config) (pconf, plog, ptemp, s); build_method_shortcuts(); init_handlers(pconf); -} - -void ap_open_logs_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s) -{ -module *m; - -for (m = top_module; m; m = m->next) - if (m->open_logs) - (*m->open_logs) (pconf, plog, ptemp, s); } void ap_child_init_hook(pool *pchild, server_rec *s) 1.14 +1 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- http_core.c 1999/07/27 21:16:39 1.13 +++ http_core.c 1999/08/01 14:12:30 1.14 @@ -2643,6 +2643,7 @@ HOOK_REALLY_LAST); ap_hook_http_method(core_method,NULL,NULL,HOOK_REALLY_LAST); ap_hook_default_port(core_port,NULL,NULL,HOOK_REALLY_LAST); +ap_hook_open_logs(core_open_logs,NULL,NULL,HOOK_MIDDLE); /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); } @@ -2650,7 +2651,6 @@ API_VAR_EXPORT module core_module = { STANDARD20_MODULE_STUFF, NULL,/* post_config */ -core_open_logs, /* open_logs */ NULL,/* child_init */ create_core_dir_config, /* create per-directory config structure */ merge_core_dir_configs, /* merge per-directory config structures */ 1.7 +2 -2 apache-2.0/mpm/src/main/http_main.c Index:
cvs commit: apache-2.0/mpm/src/main http_config.c http_connection.c http_protocol.c http_request.c
ben 99/07/31 02:31:28 Modified:mpm/src/include ap_hooks.h mpm/src/main http_config.c http_connection.c http_protocol.c http_request.c Log: Break out the hook implementations into three kinds, thus avoiding null macro arguments. Gates made me do it! Revision ChangesPath 1.10 +55 -18apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ap_hooks.h1999/07/27 21:16:36 1.9 +++ ap_hooks.h1999/07/31 09:31:17 1.10 @@ -21,7 +21,7 @@ #define HOOK_LINK(name) \ array_header *link_##name; -#define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,term1,term2,rv_final) \ +#define IMPLEMENT_HOOK_BASE(name) \ void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \ const char * const *aszSucc,int nOrder) \ { \ @@ -39,37 +39,74 @@ pHook->szName=g_szCurrentHookName; \ if(g_bDebugHooks) \ ap_show_hook(#name,aszPre,aszSucc); \ -} \ -ret ap_run_##name args \ +} + +/* RUN_ALL runs to the first one to return other than ok or decline + RUN_FIRST runs to the first one to return other than decline + VOID runs all +*/ + +#define IMPLEMENT_HOOK_VOID(name,args_decl,args_use) \ +IMPLEMENT_HOOK_BASE(name) \ +void ap_run_##name args_decl \ +{ \ +LINK_##name *pHook; \ +int n; \ +\ +if(!_hooks.link_##name) \ + return; \ +\ +pHook=(LINK_##name *)_hooks.link_##name->elts; \ +for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ + pHook[n].pFunc args_use; \ +} + +/* FIXME: note that this returns ok when nothing is run. I suspect it should + really return decline, but that breaks Apache currently - Ben +*/ +#define IMPLEMENT_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok,decline) \ +IMPLEMENT_HOOK_BASE(name) \ +ret ap_run_##name args_decl \ { \ LINK_##name *pHook; \ int n; \ -rv_decl \ +ret rv; \ \ if(!_hooks.link_##name) \ - return rv_final; \ + return ok; \ \ pHook=(LINK_##name *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - sv pHook[n].pFunc args2; \ + rv=pHook[n].pFunc args_use; \ \ - if(term1 && (!run_all || term2)) \ + if(rv != ok && rv != decline) \ return rv; \ } \ -return rv_final; \ +return ok; \ } -/* RUN_ALL runs to the first one to return other than ok or decline - RUN_FIRST runs to the first one to return other than ok -*/ -#define RUN_ALL 1 -#define RUN_FIRST0 - -#define IMPLEMENT_HOOK(ret,name,args,args2,run_all,ok,decline) \ - IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all ? ok : decline) -#define IMPLEMENT_VOID_HOOK(name,args,args2) \ - IMPLEMENT_HOOK_BASE(voidname,args,args2,RUN_ALL,1,0,) +#define IMPLEMENT_HOOK_RUN_FIRST(ret,name,args_decl,args_use,decline) \ +IMPLEMENT_HOOK_BASE(name) \ +ret ap_run_##name args_decl \ +{ \ +LINK_##name *pHook; \ +int n; \ +ret rv; \ +\ +if(!_hooks.link_##name) \ + return decline; \ +\ +pHook=(LINK_##name *)_hooks.link_##name->elts; \ +for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ + { \ + rv=pHook[n].pFunc args_use; \ +\ + if(rv != decline) \ + return rv; \ + } \ +return decline; \ +} /* Hook orderings */ #define HOOK_REALLY_FIRST(-10) 1.16 +2 -2 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- http_config.c 1999/07/27 21:16:38 1.15 +++ http_config.c 1999/07/31 09:31:20 1.16 @@ -86,8 +86,8 @@ HOOK_LINK(pre_config) ) -IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),RUN_ALL,OK,DECLINED) -IMPLEMENT_VOID_HOOK(pre_config,(pool *pconf,pool *plog,pool *ptemp), +IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED) +IMPLEMENT_HOOK_VOID(pre_config,(pool *pconf,pool *plog,pool *ptemp), (pconf,plog,ptemp)) DEF_Explain 1.14 +2 -2 apache-2.0/mpm/src/main/http_connection.c Index: http_connection.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_connecti
Re: cvs commit: apache-2.0/mpm/src/modules/mpm/mpmt_pthread mpmt_pthread.c
[EMAIL PROTECTED] wrote: > > manoj 99/07/29 13:06:20 > > Modified:mpm/src/modules/mpm/dexter dexter.c >mpm/src/modules/mpm/mpmt_pthread mpmt_pthread.c > Log: > Use Ben Hyde's warning fix on two other MPMs. Tch! Ben Laurie! Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/07/27 14:16:53 Modified:mpm/src/include ap_hooks.h http_config.h mpm/src/main http_config.c http_connection.c http_core.c http_main.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook (I won't be upset if someone else wants to do some!). Revision ChangesPath 1.9 +2 -2 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ap_hooks.h1999/07/22 19:17:15 1.8 +++ ap_hooks.h1999/07/27 21:16:36 1.9 @@ -68,8 +68,8 @@ #define IMPLEMENT_HOOK(ret,name,args,args2,run_all,ok,decline) \ IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all ? ok : decline) -#define IMPLEMENT_VOID_HOOK(name,args,args2,run_all) \ - IMPLEMENT_HOOK_BASE(voidname,args,args2,run_all,1,0,) +#define IMPLEMENT_VOID_HOOK(name,args,args2) \ + IMPLEMENT_HOOK_BASE(voidname,args,args2,RUN_ALL,1,0,) /* Hook orderings */ #define HOOK_REALLY_FIRST(-10) 1.12 +1 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- http_config.h 1999/07/27 12:04:59 1.11 +++ http_config.h 1999/07/27 21:16:36 1.12 @@ -211,7 +211,6 @@ * (see also mod_so). */ -void (*pre_config)(pool *pconf, pool *plog, pool *ptemp); void (*open_logs)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*post_config)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*child_init)(pool *pchild, server_rec *); @@ -333,7 +332,6 @@ void ap_setup_prelinked_modules(void); void ap_show_directives(void); void ap_show_modules(void); -void ap_pre_config_hook(pool *pconf, pool *plog, pool *ptemp); server_rec *ap_read_config(pool *conf_pool, pool *temp_pool, const char *config_name); void ap_open_logs_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s); void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s); @@ -375,6 +373,7 @@ /* Hooks */ DECLARE_HOOK(int,header_parser,(request_rec *)) +DECLARE_HOOK(void,pre_config,(pool *pconf,pool *plog,pool *ptemp)) #endif 1.15 +5 -11 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- http_config.c 1999/07/27 12:05:00 1.14 +++ http_config.c 1999/07/27 21:16:38 1.15 @@ -83,8 +83,13 @@ HOOK_STRUCT( HOOK_LINK(header_parser) + HOOK_LINK(pre_config) ) +IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),RUN_ALL,OK,DECLINED) +IMPLEMENT_VOID_HOOK(pre_config,(pool *pconf,pool *plog,pool *ptemp), + (pconf,plog,ptemp)) + DEF_Explain / @@ -362,8 +367,6 @@ return run_method(r, offsets_into_method_ptrs.access_checker, 1); } -IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),RUN_ALL,OK,DECLINED) - /* Auth stuff --- anything that defines one of these will presumably * want to define something for the other. Note that check_auth is * separate from check_access to make catching some config errors easier. @@ -1435,15 +1438,6 @@ if (m->create_dir_config) ap_set_module_config(s->lookup_defaults, m, (*m->create_dir_config)(p, NULL)); -} - -void ap_pre_config_hook(pool *pconf, pool *plog, pool *ptemp) -{ -module *m; - -for (m = top_module; m; m = m->next) - if (m->pre_config) - (*m->pre_config) (pconf, plog, ptemp); } void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s) 1.13 +1 -1 apache-2.0/mpm/src/main/http_connection.c Index: http_connection.c === RCS file: /exp
cvs commit: apache-2.0/mpm/src/modules/mpm/prefork prefork.c
ben 99/07/27 06:31:21 Modified:mpm/src/modules/mpm/prefork prefork.c Log: Fix a warning. Revision ChangesPath 1.20 +1 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- prefork.c 1999/07/27 12:05:04 1.19 +++ prefork.c 1999/07/27 13:31:20 1.20 @@ -2872,7 +2872,7 @@ { static int restart_num = 0; -one_process = getenv("ONE_PROCESS"); +one_process = !!getenv("ONE_PROCESS"); /* sigh, want this only the second time around */ if (restart_num++ == 1) {
cvs commit: apache-2.0/mpm/src/main Makefile.tmpl
ben 99/07/25 07:26:37 Modified:mpm/src/main Makefile.tmpl Log: Make dependencies. Revision ChangesPath 1.15 +2 -1 apache-2.0/mpm/src/main/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/Makefile.tmpl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Makefile.tmpl 1999/07/24 18:41:09 1.14 +++ Makefile.tmpl 1999/07/25 14:26:37 1.15 @@ -164,7 +164,8 @@ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ $(INCDIR)/apr.h $(INCDIR)/util_uri.h $(INCDIR)/http_main.h \ - $(INCDIR)/http_log.h test_char.h + $(INCDIR)/http_log.h $(INCDIR)/http_protocol.h \ + $(INCDIR)/ap_hooks.h test_char.h util_date.o: util_date.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ $(INCDIR)/ap_ctype.h $(INCDIR)/util_date.h
cvs commit: apache-2.0/mpm/src/main http_core.c http_protocol.c util.c
ben 99/07/25 07:24:03 Modified:mpm/src/include http_protocol.h httpd.h mpm/src/main http_core.c http_protocol.c util.c Log: Add some more hooks. Revision ChangesPath 1.4 +2 -0 apache-2.0/mpm/src/include/http_protocol.h Index: http_protocol.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_protocol.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_protocol.h 1999/07/17 10:35:34 1.3 +++ http_protocol.h 1999/07/25 14:24:00 1.4 @@ -225,6 +225,8 @@ */ DECLARE_HOOK(int,post_read_request,(request_rec *)) DECLARE_HOOK(int,log_transaction,(request_rec *)) +DECLARE_HOOK(const char *,http_method,(const request_rec *)) +DECLARE_HOOK(unsigned short,default_port,(const request_rec *)) #ifdef __cplusplus } 1.9 +2 -2 apache-2.0/mpm/src/include/httpd.h Index: httpd.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/httpd.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- httpd.h 1999/07/19 05:17:49 1.8 +++ httpd.h 1999/07/25 14:24:00 1.9 @@ -140,8 +140,8 @@ #define DEFAULT_HTTP_PORT80 #define DEFAULT_HTTPS_PORT 443 #define ap_is_default_port(port,r) ((port) == ap_default_port(r)) -#define ap_http_method(r)"http" -#define ap_default_port(r) DEFAULT_HTTP_PORT +#define ap_http_method(r)ap_run_http_method(r) +#define ap_default_port(r) ap_run_default_port(r) /* - Default user name and group name running standalone -- */ /* --- These may be specified as numbers by placing a # before a number --- */ 1.11 +8 -0 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- http_core.c 1999/07/24 18:38:48 1.10 +++ http_core.c 1999/07/25 14:24:01 1.11 @@ -2630,11 +2630,19 @@ ap_open_logs(s, pconf); } +static const char *core_method(const request_rec *r) +{ return "http"; } + +static unsigned short core_port(const request_rec *r) +{ return DEFAULT_HTTP_PORT; } + static void register_hooks() { ap_hook_translate_name(core_translate,NULL,NULL,HOOK_REALLY_LAST); ap_hook_process_connection(ap_process_http_connection,NULL,NULL, HOOK_REALLY_LAST); +ap_hook_http_method(core_method,NULL,NULL,HOOK_REALLY_LAST); +ap_hook_default_port(core_port,NULL,NULL,HOOK_REALLY_LAST); /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); } 1.13 +5 -0 apache-2.0/mpm/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_protocol.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- http_protocol.c 1999/07/17 10:35:41 1.12 +++ http_protocol.c 1999/07/25 14:24:01 1.13 @@ -78,6 +78,8 @@ HOOK_STRUCT( HOOK_LINK(post_read_request) HOOK_LINK(log_transaction) + HOOK_LINK(http_method) + HOOK_LINK(default_port) ); #define SET_BYTES_SENT(r) \ @@ -2691,3 +2693,6 @@ IMPLEMENT_HOOK(int,post_read_request,(request_rec *r),(r),RUN_ALL,OK,DECLINED) IMPLEMENT_HOOK(int,log_transaction,(request_rec *r),(r),RUN_ALL,OK,DECLINED) +IMPLEMENT_HOOK(const char *,http_method,(const request_rec *r),(r),RUN_FIRST, +NULL,NULL) +IMPLEMENT_HOOK(unsigned short,default_port,(const request_rec *r),(r),RUN_FIRST,0,0) 1.3 +1 -0 apache-2.0/mpm/src/main/util.c Index: util.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- util.c1999/07/12 22:51:10 1.2 +++ util.c1999/07/25 14:24:01 1.3 @@ -71,6 +71,7 @@ #include "httpd.h" #include "http_main.h" #include "http_log.h" +#include "http_protocol.h" #if defined(SUNOS4) /* stdio.h has been read in ap_config.h already. Add missing prototypes here: */ extern int fgetc(FILE *);
cvs commit: apache-2.0/mpm/src/modules/mpm/prefork prefork.c
ben 99/07/25 07:03:17 Modified:mpm/src/modules/mpm/prefork prefork.c Log: Make sure we terminate. Revision ChangesPath 1.18 +7 -3 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- prefork.c 1999/07/25 13:58:58 1.17 +++ prefork.c 1999/07/25 14:03:16 1.18 @@ -2160,17 +2160,21 @@ } else { lr = last_lr->next; + if (!lr) + lr = ap_listeners; } first_lr=lr; do { - if (!lr) { - lr = ap_listeners; - } if (FD_ISSET(lr->fd, &main_fds)) goto got_listener; lr = lr->next; + if (!lr) + lr = ap_listeners; } while (lr != first_lr); + /* FIXME: if we get here, something bad has happened, and we're +probably gonna spin forever. + */ continue; got_listener: last_lr = lr;
cvs commit: apache-2.0/mpm/src/modules/mpm/prefork prefork.c
ben 99/07/25 06:58:59 Modified:mpm/src/modules/mpm/prefork prefork.c Log: Good grief! How hard is it to try _all_ the elements in a list? Revision ChangesPath 1.17 +4 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- prefork.c 1999/07/24 18:38:55 1.16 +++ prefork.c 1999/07/25 13:58:58 1.17 @@ -2061,6 +2061,7 @@ struct sockaddr sa_client; ap_listen_rec *lr; ap_listen_rec *last_lr; +ap_listen_rec *first_lr; pool *ptrans; conn_rec *current_conn; ap_iol *iol; @@ -2160,7 +2161,8 @@ else { lr = last_lr->next; } - while (lr != last_lr) { + first_lr=lr; + do { if (!lr) { lr = ap_listeners; } @@ -2168,6 +2170,7 @@ goto got_listener; lr = lr->next; } + while (lr != first_lr); continue; got_listener: last_lr = lr;
cvs commit: apache-2.0/mpm/src/modules/standard mod_echo.c
ben 99/07/24 13:54:36 Modified:mpm/src/modules/standard mod_echo.c Log: Allow for new hooks. Revision ChangesPath 1.2 +0 -2 apache-2.0/mpm/src/modules/standard/mod_echo.c Index: mod_echo.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_echo.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mod_echo.c1999/07/23 18:52:29 1.1 +++ mod_echo.c1999/07/24 20:54:36 1.2 @@ -76,7 +76,5 @@ NULL,/* handlers */ NULL,/* check auth */ NULL,/* check access */ -NULL,/* type_checker */ -NULL,/* pre-run fixups */ register_hooks /* register hooks */ };
cvs commit: apache-2.0/mpm/src/modules/standard Makefile.tmpl
ben 99/07/24 11:41:26 Modified:mpm/src/main Makefile.tmpl mpm/src/modules/standard Makefile.tmpl Log: Update dependencies. Revision ChangesPath 1.14 +1 -1 apache-2.0/mpm/src/main/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/Makefile.tmpl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Makefile.tmpl 1999/07/16 18:24:25 1.13 +++ Makefile.tmpl 1999/07/24 18:41:09 1.14 @@ -103,7 +103,7 @@ $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ $(INCDIR)/http_vhost.h $(INCDIR)/http_main.h $(INCDIR)/http_log.h \ $(INCDIR)/rfc1413.h $(INCDIR)/util_md5.h $(INCDIR)/ap_md5.h \ - $(INCDIR)/fnmatch.h + $(INCDIR)/fnmatch.h $(INCDIR)/http_connection.h http_log.o: http_log.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ 1.9 +10 -2 apache-2.0/mpm/src/modules/standard/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/Makefile.tmpl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Makefile.tmpl 1999/07/17 10:35:50 1.8 +++ Makefile.tmpl 1999/07/24 18:41:20 1.9 @@ -125,12 +125,20 @@ $(INCDIR)/http_core.h $(INCDIR)/http_request.h \ $(INCDIR)/http_protocol.h $(INCDIR)/http_log.h \ $(INCDIR)/http_main.h $(INCDIR)/util_script.h +mod_echo.o: mod_echo.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ + $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h \ + $(OSDIR)/os.h $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ + $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ + $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h \ + $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ + $(INCDIR)/http_connection.h mod_env.o: mod_env.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h \ $(OSDIR)/os.h $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h \ - $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h + $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ + $(INCDIR)/http_request.h mod_expires.o: mod_expires.c $(INCDIR)/httpd.h \ $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ @@ -205,7 +213,7 @@ $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h \ $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ - $(INCDIR)/http_log.h + $(INCDIR)/http_log.h $(INCDIR)/http_request.h mod_mime_magic.o: mod_mime_magic.c $(INCDIR)/httpd.h \ $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/07/24 11:39:21 Modified:mpm/src/include http_config.h http_request.h mpm/src/main http_config.c http_core.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision ChangesPath 1.10 +0 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- http_config.h 1999/07/24 18:15:52 1.9 +++ http_config.h 1999/07/24 18:38:37 1.10 @@ -241,7 +241,6 @@ int (*auth_checker) (request_rec *); int (*access_checker) (request_rec *); -int (*type_checker) (request_rec *); void (*register_hooks) (void); } module; @@ -367,7 +366,6 @@ int ap_check_access(request_rec *); /* check access on non-auth basis */ int ap_check_user_id(request_rec *); /* obtain valid username from client auth */ int ap_check_auth(request_rec *);/* check (validated) user is authorized here */ -int ap_find_types(request_rec *);/* identify MIME type */ int ap_invoke_handler(request_rec *); /* for mod_perl */ 1.5 +1 -0 apache-2.0/mpm/src/include/http_request.h Index: http_request.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_request.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_request.h1999/07/24 18:15:53 1.4 +++ http_request.h1999/07/24 18:38:38 1.5 @@ -116,6 +116,7 @@ DECLARE_HOOK(int,translate_name,(request_rec *)) DECLARE_HOOK(int,check_user_id,(request_rec *)) DECLARE_HOOK(int,fixups,(request_rec *)) +DECLARE_HOOK(int,type_checker,(request_rec *)) #ifdef __cplusplus } 1.13 +0 -8 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- http_config.c 1999/07/24 18:15:56 1.12 +++ http_config.c 1999/07/24 18:38:46 1.13 @@ -238,7 +238,6 @@ { #define m(meth) { XtOffsetOf(module,meth),#meth } m(auth_checker), -m(type_checker), { -1, "?" }, #undef m }; @@ -275,14 +274,12 @@ { XtOffsetOf(module, auth_checker), XtOffsetOf(module, access_checker), -XtOffsetOf(module, type_checker), }; #define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) static struct { int auth_checker; int access_checker; -int type_checker; } offsets_into_method_ptrs; /* @@ -363,11 +360,6 @@ int ap_check_access(request_rec *r) { return run_method(r, offsets_into_method_ptrs.access_checker, 1); -} - -int ap_find_types(request_rec *r) -{ -return run_method(r, offsets_into_method_ptrs.type_checker, 0); } IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),RUN_ALL,OK,DECLINED) 1.10 +2 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- http_core.c 1999/07/24 18:15:56 1.9 +++ http_core.c 1999/07/24 18:38:48 1.10 @@ -2635,6 +2635,8 @@ ap_hook_translate_name(core_translate,NULL,NULL,HOOK_REALLY_LAST); ap_hook_process_connection(ap_process_http_connection,NULL,NULL, HOOK_REALLY_LAST); +/* FIXME: I suspect we can eliminate the need for these - Ben */ +ap_hook_type_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); } API_VAR_EXPORT module core_module = { @@ -2652,6 +2654,5 @@ core_handlers, /* handlers */ NULL,/* check auth */ do_nothing, /* check access */ -do_nothing, /* type_checker */ register_hooks /* register hooks */ }; 1.14 +6 -4 apache-2.0/mpm/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving rev
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/07/24 11:16:38 Modified:mpm/src/include http_config.h http_request.h mpm/src/main http_config.c http_core.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision ChangesPath 1.9 +0 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- http_config.h 1999/07/17 10:35:33 1.8 +++ http_config.h 1999/07/24 18:15:52 1.9 @@ -242,7 +242,6 @@ int (*auth_checker) (request_rec *); int (*access_checker) (request_rec *); int (*type_checker) (request_rec *); -int (*fixer_upper) (request_rec *); void (*register_hooks) (void); } module; @@ -369,7 +368,6 @@ int ap_check_user_id(request_rec *); /* obtain valid username from client auth */ int ap_check_auth(request_rec *);/* check (validated) user is authorized here */ int ap_find_types(request_rec *);/* identify MIME type */ -int ap_run_fixups(request_rec *);/* poke around for other metainfo, etc */ int ap_invoke_handler(request_rec *); /* for mod_perl */ 1.4 +1 -0 apache-2.0/mpm/src/include/http_request.h Index: http_request.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_request.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_request.h1999/07/11 19:00:47 1.3 +++ http_request.h1999/07/24 18:15:53 1.4 @@ -115,6 +115,7 @@ /* Hooks */ DECLARE_HOOK(int,translate_name,(request_rec *)) DECLARE_HOOK(int,check_user_id,(request_rec *)) +DECLARE_HOOK(int,fixups,(request_rec *)) #ifdef __cplusplus } 1.12 +0 -8 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- http_config.c 1999/07/17 10:35:39 1.11 +++ http_config.c 1999/07/24 18:15:56 1.12 @@ -239,7 +239,6 @@ #define m(meth) { XtOffsetOf(module,meth),#meth } m(auth_checker), m(type_checker), -m(fixer_upper), { -1, "?" }, #undef m }; @@ -277,7 +276,6 @@ XtOffsetOf(module, auth_checker), XtOffsetOf(module, access_checker), XtOffsetOf(module, type_checker), -XtOffsetOf(module, fixer_upper), }; #define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) @@ -285,7 +283,6 @@ int auth_checker; int access_checker; int type_checker; -int fixer_upper; } offsets_into_method_ptrs; /* @@ -371,11 +368,6 @@ int ap_find_types(request_rec *r) { return run_method(r, offsets_into_method_ptrs.type_checker, 0); -} - -int ap_run_fixups(request_rec *r) -{ -return run_method(r, offsets_into_method_ptrs.fixer_upper, 1); } IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),RUN_ALL,OK,DECLINED) 1.9 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- http_core.c 1999/07/22 19:17:22 1.8 +++ http_core.c 1999/07/24 18:15:56 1.9 @@ -2653,6 +2653,5 @@ NULL,/* check auth */ do_nothing, /* check access */ do_nothing, /* type_checker */ -NULL,/* pre-run fixups */ register_hooks /* register hooks */ }; 1.13 +2 -0 apache-2.0/mpm/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- http_request.c1999/07/22 19:17:23 1.12 +++ http_request.c1999/07/24 18:15:57 1.13 @@ -81,10 +81,12 @@ HOOK_STRUCT( HOOK_LINK(translate_name) HOOK_LINK(check_user_id) + HOOK_LINK(fixups) ) IMPL
cvs commit: apache-2.0/mpm/src/modules/mpm/prefork prefork.c
ben 99/07/24 06:55:57 Modified:mpm/src/modules/mpm/prefork prefork.c Log: Fix listener selection logic. Revision ChangesPath 1.14 +4 -4 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- prefork.c 1999/07/17 10:35:48 1.13 +++ prefork.c 1999/07/24 13:55:56 1.14 @@ -2164,12 +2164,12 @@ if (!lr) { lr = ap_listeners; } - if (FD_ISSET(lr->fd, &main_fds)) break; + if (FD_ISSET(lr->fd, &main_fds)) + goto got_listener; lr = lr->next; } - if (lr == last_lr) { - continue; - } + continue; + got_listener: last_lr = lr; sd = lr->fd; }
cvs commit: apache-2.0/mpm/src/modules/standard mod_echo.c
ben 99/07/23 11:52:29 Modified:mpm/src Configuration.tmpl Added: mpm/src/modules/standard mod_echo.c Log: Support for echo protocol, to show how multiprotocol support works. Revision ChangesPath 1.5 +4 -0 apache-2.0/mpm/src/Configuration.tmpl Index: Configuration.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/Configuration.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Configuration.tmpl1999/07/10 18:20:16 1.4 +++ Configuration.tmpl1999/07/23 18:52:28 1.5 @@ -414,3 +414,7 @@ AddModule modules/standard/mod_setenvif.o +## Demonstration module for the TCP echo protocol, just to show how +## multiprotocol support works. + +AddModule modules/standard/mod_echo.o 1.1 apache-2.0/mpm/src/modules/standard/mod_echo.c Index: mod_echo.c === #include "httpd.h" #include "http_config.h" #include "http_connection.h" API_VAR_EXPORT module echo_module; typedef struct { int bEnabled; } EchoConfig; static void *create_echo_server_config(pool *p,server_rec *s) { EchoConfig *pConfig=ap_pcalloc(p,sizeof *pConfig); pConfig->bEnabled=0; return pConfig; } static const char *echo_on(cmd_parms *cmd, void *dummy, char *arg) { EchoConfig *pConfig=ap_get_module_config(cmd->server->module_config, &echo_module); pConfig->bEnabled=1; return NULL; } static int process_echo_connection(conn_rec *c) { char buf[1024]; EchoConfig *pConfig=ap_get_module_config(c->base_server->module_config, &echo_module); if(!pConfig->bEnabled) return DECLINED; for( ; ; ) { int w; int r=ap_bread(c->client,buf,sizeof buf); if(r <= 0) break; w=ap_bwrite(c->client,buf,r); if(w != r) break; ap_bflush(c->client); } return OK; } static const command_rec echo_cmds[] = { { "ProtocolEcho", echo_on, NULL, RSRC_CONF, RAW_ARGS, "Run an echo server on this host" }, { NULL } }; static void register_hooks() { ap_hook_process_connection(process_echo_connection,NULL,NULL,HOOK_MIDDLE); } API_VAR_EXPORT module echo_module = { STANDARD20_MODULE_STUFF, NULL, /* pre_command_line */ NULL, /* pre_config */ NULL, /* post_config */ NULL, /* open_logs */ NULL, /* child_init */ NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ create_echo_server_config,/* create per-server config structure */ NULL, /* merge per-server config structures */ echo_cmds,/* command table */ NULL, /* handlers */ NULL, /* check auth */ NULL, /* check access */ NULL, /* type_checker */ NULL, /* pre-run fixups */ register_hooks/* register hooks */ };
cvs commit: apache-2.0/mpm/src/main http_connection.c
ben 99/07/23 11:14:45 Modified:mpm/src/main http_connection.c Log: Actually, we should always close the connection when it is finished. Revision ChangesPath 1.12 +22 -22apache-2.0/mpm/src/main/http_connection.c Index: http_connection.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_connection.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- http_connection.c 1999/07/22 19:17:21 1.11 +++ http_connection.c 1999/07/23 18:14:44 1.12 @@ -197,6 +197,28 @@ ap_run_pre_connection(c); ap_run_process_connection(c); + +/* + * Close the connection, being careful to send out whatever is still + * in our buffers. If possible, try to avoid a hard close until the + * client has ACKed our FIN and/or has stopped sending us data. + */ + +#ifdef NO_LINGCLOSE +ap_bclose(c->client);/* just close it */ +#else +if (r && r->connection + && !r->connection->aborted + && r->connection->client + && (r->connection->client->fd >= 0)) { + + lingering_close(r); +} +else { + ap_bsetflag(c->client, B_EOUT, 1); + ap_bclose(c->client); +} +#endif } int ap_process_http_connection(conn_rec *c) @@ -226,28 +248,6 @@ return OK; } } - -/* - * Close the connection, being careful to send out whatever is still - * in our buffers. If possible, try to avoid a hard close until the - * client has ACKed our FIN and/or has stopped sending us data. - */ - -#ifdef NO_LINGCLOSE -ap_bclose(c->client);/* just close it */ -#else -if (r && r->connection - && !r->connection->aborted - && r->connection->client - && (r->connection->client->fd >= 0)) { - - lingering_close(r); -} -else { - ap_bsetflag(c->client, B_EOUT, 1); - ap_bclose(c->client); -} -#endif return OK; }
cvs commit: apache-2.0/mpm/src/main http_connection.c http_core.c http_request.c
ben 99/07/22 12:17:26 Modified:mpm/src/include ap_hooks.h http_connection.h mpm/src/main http_connection.c http_core.c http_request.c Log: And with one bound, he was free! This seemingly minor change allows modules to take over connection processing, thus making Apache multiprotocol. Woo! Revision ChangesPath 1.8 +4 -1 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ap_hooks.h1999/07/11 16:54:02 1.7 +++ ap_hooks.h1999/07/22 19:17:15 1.8 @@ -60,8 +60,11 @@ return rv_final; \ } +/* RUN_ALL runs to the first one to return other than ok or decline + RUN_FIRST runs to the first one to return other than ok +*/ #define RUN_ALL 1 -#define RUN_TO_FIRST_ERROR 0 +#define RUN_FIRST0 #define IMPLEMENT_HOOK(ret,name,args,args2,run_all,ok,decline) \ IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all ? ok : decline) 1.5 +2 -0 apache-2.0/mpm/src/include/http_connection.h Index: http_connection.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_connection.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_connection.h 1999/07/05 13:00:42 1.4 +++ http_connection.h 1999/07/22 19:17:16 1.5 @@ -69,9 +69,11 @@ const struct sockaddr_in *saddr, int child_num, int thread_num); CORE_EXPORT(void) ap_process_connection(conn_rec *); +int ap_process_http_connection(conn_rec *); /* Hooks */ DECLARE_HOOK(void,pre_connection,(conn_rec *)) +DECLARE_HOOK(int,process_connection,(conn_rec *)) #ifdef __cplusplus } 1.11 +12 -3 apache-2.0/mpm/src/main/http_connection.c Index: http_connection.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_connection.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- http_connection.c 1999/07/11 16:42:24 1.10 +++ http_connection.c 1999/07/22 19:17:21 1.11 @@ -66,9 +66,11 @@ HOOK_STRUCT( HOOK_LINK(pre_connection) + HOOK_LINK(process_connection) ); IMPLEMENT_VOID_HOOK(pre_connection,(conn_rec *c),(c),RUN_ALL) +IMPLEMENT_HOOK(int,process_connection,(conn_rec *c),(c),RUN_FIRST,OK,DECLINED) /* TODO: re-implement the lingering close stuff */ #define NO_LINGCLOSE @@ -190,12 +192,17 @@ CORE_EXPORT(void) ap_process_connection(conn_rec *c) { -request_rec *r; - ap_update_vhost_given_ip(c); ap_run_pre_connection(c); +ap_run_process_connection(c); +} + +int ap_process_http_connection(conn_rec *c) +{ +request_rec *r; + /* * Read and process each request found on our connection * until no requests are left or we decide to close. @@ -216,7 +223,7 @@ if (ap_graceful_stop_signalled()) { /* XXX: hey wait, this should do a lingering_close! */ ap_bclose(c->client); - return; + return OK; } } @@ -241,6 +248,8 @@ ap_bclose(c->client); } #endif + +return OK; } /* Clearly some of this stuff doesn't belong in a generalised connection 1.8 +3 -0 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- http_core.c 1999/07/17 10:35:40 1.7 +++ http_core.c 1999/07/22 19:17:22 1.8 @@ -67,6 +67,7 @@ #include "rfc1413.h" #include "util_md5.h" #include "fnmatch.h" +#include "http_connection.h" #ifdef USE_MMAP_FILES #include @@ -2632,6 +2633,8 @@ static void register_hooks() { ap_hook_translate_name(core_translate,NULL,NULL,HOOK_REALLY_LAST); +ap_hook_process_connection(ap_process_http_connection,NULL,NULL, +HOOK_REALLY_LAST); } API_VAR_EXPORT module core_module = { 1.12 +2 -4 apache-2.0/mpm/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11
Re: cvs commit: apache-1.3/src/main http_main.c
[EMAIL PROTECTED] wrote: > > coar99/07/20 10:44:21 > > Modified:src/main http_main.c > Log: > *SecurityDescriptor() should be returning an error on Win98, but > sometimes doesn't -- so check the last error if it claims all > went well, just in case it's fibbing. Eeek! Things that _don't_ fail don't clear the last error in general. Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/mpm/src/modules/standard Makefile.tmpl mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/07/17 03:36:05 Modified:mpm/src/include http_config.h http_protocol.h mpm/src/main http_config.c http_core.c http_protocol.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard Makefile.tmpl mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision ChangesPath 1.8 +0 -4 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- http_config.h 1999/07/11 19:00:47 1.7 +++ http_config.h 1999/07/17 10:35:33 1.8 @@ -237,14 +237,12 @@ * supposed to handle this was configured wrong). * type_checker --- Determine MIME type of the requested entity; * sets content_type, _encoding and _language fields. - * logger --- log a transaction. */ int (*auth_checker) (request_rec *); int (*access_checker) (request_rec *); int (*type_checker) (request_rec *); int (*fixer_upper) (request_rec *); -int (*logger) (request_rec *); void (*register_hooks) (void); } module; @@ -373,8 +371,6 @@ int ap_find_types(request_rec *);/* identify MIME type */ int ap_run_fixups(request_rec *);/* poke around for other metainfo, etc */ int ap_invoke_handler(request_rec *); -int ap_log_transaction(request_rec *r); -int ap_run_post_read_request(request_rec *); /* for mod_perl */ 1.3 +1 -0 apache-2.0/mpm/src/include/http_protocol.h Index: http_protocol.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_protocol.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- http_protocol.h 1999/07/06 21:32:08 1.2 +++ http_protocol.h 1999/07/17 10:35:34 1.3 @@ -224,6 +224,7 @@ * and not run during any subrequests. */ DECLARE_HOOK(int,post_read_request,(request_rec *)) +DECLARE_HOOK(int,log_transaction,(request_rec *)) #ifdef __cplusplus } 1.11 +0 -8 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- http_config.c 1999/07/11 19:00:48 1.10 +++ http_config.c 1999/07/17 10:35:39 1.11 @@ -240,7 +240,6 @@ m(auth_checker), m(type_checker), m(fixer_upper), -m(logger), { -1, "?" }, #undef m }; @@ -279,7 +278,6 @@ XtOffsetOf(module, access_checker), XtOffsetOf(module, type_checker), XtOffsetOf(module, fixer_upper), -XtOffsetOf(module, logger) }; #define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) @@ -288,7 +286,6 @@ int access_checker; int type_checker; int fixer_upper; -int logger; } offsets_into_method_ptrs; /* @@ -379,11 +376,6 @@ int ap_run_fixups(request_rec *r) { return run_method(r, offsets_into_method_ptrs.fixer_upper, 1); -} - -int ap_log_transaction(request_rec *r) -{ -return run_method(r, offsets_into_method_ptrs.logger, 1); } IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),RUN_ALL,OK,DECLINED) 1.7 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- http_core.c 1999/07/11 19:00:48 1.6 +++ http_core.c 1999/07/17 10:35:40 1.7 @@ -2651,6 +2651,5 @@ do_nothing, /* check access */ do_nothing, /* type_checker */ NULL,/* pre-run fixups */ -NULL,/* logger */ register_hooks /* register hooks */ }; 1.12 +8 -6 apache-2.0/mpm/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_protocol.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- http_
cvs commit: apache-2.0/mpm/src/modules/standard Makefile.tmpl
ben 99/07/16 11:24:27 Modified:mpm/src Configure mpm/src/main Makefile.tmpl mpm/src/modules/mpm/prefork Makefile.tmpl mpm/src/modules/standard Makefile.tmpl Log: Make dependencies work again. Revision ChangesPath 1.13 +14 -14apache-2.0/mpm/src/Configure Index: Configure === RCS file: /export/home/cvs/apache-2.0/mpm/src/Configure,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Configure 1999/07/12 22:51:06 1.12 +++ Configure 1999/07/16 18:24:23 1.13 @@ -790,12 +790,25 @@ SUBDIRS="$OSDIR $SUBDIRS" +## Now handle the MPM implementation. Default to 1.3 prefork +## +if [ "x$RULE_MPM_METHOD" = "xdefault" ]; then +if [ "x$DEF_MPM_METHOD" = "x" ]; then + RULE_MPM_METHOD="prefork" +else + RULE_MPM_METHOD="$DEF_MPM_METHOD" +fi +fi +## +MPM_METHOD="$RULE_MPM_METHOD" + + # Continue building the stub file # Set variables as soon as possible so that TestCompile can use them ## echo >>Makefile.config "OSDIR=\$(SRCDIR)/$OSDIR" echo >>Makefile.config "INCDIR=\$(SRCDIR)/include" -echo >>Makefile.config "INCLUDES0=-I\$(OSDIR) -I\$(INCDIR)" +echo >>Makefile.config "INCLUDES0=-I\$(OSDIR) -I\$(INCDIR) -I\$(SRCDIR)/modules/mpm/$MPM_METHOD" echo >>Makefile.config "SHELL=$SHELL" @@ -808,19 +821,6 @@ RULE_WANTHSREGEX=$DEF_WANTHSREGEX fi fi - - -## Now handle the MPM implementation. Default to 1.3 prefork -## -if [ "x$RULE_MPM_METHOD" = "xdefault" ]; then -if [ "x$DEF_MPM_METHOD" = "x" ]; then - RULE_MPM_METHOD="prefork" -else - RULE_MPM_METHOD="$DEF_MPM_METHOD" -fi -fi -## -MPM_METHOD="$RULE_MPM_METHOD" ## Now we determine the C-compiler and optimization level 1.13 +0 -8 apache-2.0/mpm/src/main/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/Makefile.tmpl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Makefile.tmpl 1999/07/11 16:36:51 1.12 +++ Makefile.tmpl 1999/07/16 18:24:25 1.13 @@ -153,14 +153,6 @@ $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ $(INCDIR)/apr.h $(INCDIR)/util_uri.h $(INCDIR)/http_config.h \ $(INCDIR)/ap_hooks.h $(INCDIR)/ap_listen.h $(INCDIR)/http_log.h -mpm_prefork.o: mpm_prefork.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ - $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ - $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ - $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ - $(INCDIR)/apr.h $(INCDIR)/util_uri.h $(INCDIR)/http_main.h \ - $(INCDIR)/http_log.h $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ - $(INCDIR)/http_core.h $(INCDIR)/http_connection.h \ - $(INCDIR)/scoreboard_prefork.h rfc1413.o: rfc1413.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ 1.8 +3 -4 apache-2.0/mpm/src/modules/mpm/prefork/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/Makefile.tmpl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Makefile.tmpl 1999/07/16 05:30:31 1.7 +++ Makefile.tmpl 1999/07/16 18:24:25 1.8 @@ -59,10 +59,9 @@ $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ - $(INCDIR)/hsregex.h $(INCDIR)/alloc.h \ - $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ - $(INCDIR)/ap.h $(INCDIR)/apr.h \ - $(INCDIR)/util_uri.h mpm_default.h \ + $(INCDIR)/alloc.h $(INCDIR)/buff.h \ + $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ + $(INCDIR)/apr.h $(INCDIR)/util_uri.h mpm_default.h \ $(INCDIR)/http_main.h $(INCDIR)/http_log.h \ $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ $(INCDIR)/http_core.h $(INCDIR)/http_connection.h \ 1.7 +3 -2 apache-2.0/mpm/src/modules/standard/Makefile.tmpl Index: Ma
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/07/11 12:00:57 Modified:mpm/src/include http_config.h http_request.h mpm/src/main http_config.c http_core.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision ChangesPath 1.7 +0 -1 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- http_config.h 1999/07/11 13:27:24 1.6 +++ http_config.h 1999/07/11 19:00:47 1.7 @@ -240,7 +240,6 @@ * logger --- log a transaction. */ -int (*ap_check_user_id) (request_rec *); int (*auth_checker) (request_rec *); int (*access_checker) (request_rec *); int (*type_checker) (request_rec *); 1.3 +1 -0 apache-2.0/mpm/src/include/http_request.h Index: http_request.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_request.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- http_request.h1999/07/11 13:27:24 1.2 +++ http_request.h1999/07/11 19:00:47 1.3 @@ -114,6 +114,7 @@ /* Hooks */ DECLARE_HOOK(int,translate_name,(request_rec *)) +DECLARE_HOOK(int,check_user_id,(request_rec *)) #ifdef __cplusplus } 1.10 +0 -8 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- http_config.c 1999/07/11 16:42:23 1.9 +++ http_config.c 1999/07/11 19:00:48 1.10 @@ -237,7 +237,6 @@ { #define m(meth) { XtOffsetOf(module,meth),#meth } -m(ap_check_user_id), m(auth_checker), m(type_checker), m(fixer_upper), @@ -276,7 +275,6 @@ */ static const int method_offsets[] = { -XtOffsetOf(module, ap_check_user_id), XtOffsetOf(module, auth_checker), XtOffsetOf(module, access_checker), XtOffsetOf(module, type_checker), @@ -286,7 +284,6 @@ #define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) static struct { -int ap_check_user_id; int auth_checker; int access_checker; int type_checker; @@ -395,11 +392,6 @@ * want to define something for the other. Note that check_auth is * separate from check_access to make catching some config errors easier. */ - -int ap_check_user_id(request_rec *r) -{ -return run_method(r, offsets_into_method_ptrs.ap_check_user_id, 0); -} int ap_check_auth(request_rec *r) { 1.6 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- http_core.c 1999/07/11 16:54:04 1.5 +++ http_core.c 1999/07/11 19:00:48 1.6 @@ -2647,7 +2647,6 @@ merge_core_server_configs, /* merge per-server config structures */ core_cmds, /* command table */ core_handlers, /* handlers */ -NULL,/* check_user_id */ NULL,/* check auth */ do_nothing, /* check access */ do_nothing, /* type_checker */ 1.10 +9 -6 apache-2.0/mpm/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- http_request.c1999/07/11 16:42:24 1.9 +++ http_request.c1999/07/11 19:00:49 1.10 @@ -80,10 +80,13 @@ HOOK_STRUCT( HOOK_LINK(translate_name) + HOOK_LINK(check_user_id) ) IMPLEMENT_HOOK(int,translate_name,(request_rec *r),(r),RUN_TO_FIRST_ERROR,OK, DECLINED) +IMPLEMENT_HOOK(int,check_user_id,(request_rec *r),(r),RUN_TO_FIRST_ERROR,OK, +DECLINED) /* * @@ -803,11 +806,11 @@ || ap_satisfies(rnew) == SATISFY_NOSPEC
cvs commit: apache-2.0/mpm/src/modules/standard mod_alias.c mod_setenvif.c mod_userdir.c
ben 99/07/11 09:54:10 Modified:mpm/src/ap ap_hooks.c mpm/src/include ap_hooks.h mpm/src/main http_core.c mpm/src/modules/standard mod_alias.c mod_setenvif.c mod_userdir.c Log: Add non-topological ordering for hooks. Revision ChangesPath 1.2 +10 -0 apache-2.0/mpm/src/ap/ap_hooks.c Index: ap_hooks.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/ap_hooks.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ap_hooks.c1999/07/11 13:27:23 1.1 +++ ap_hooks.c1999/07/11 16:54:00 1.2 @@ -13,6 +13,7 @@ const char *szName; const char * const *aszPredecessors; const char * const *aszSuccessors; +int nOrder; } TSortData; typedef struct tsort_ @@ -23,11 +24,20 @@ struct tsort_ *pNext; } TSort; +static int crude_order(const void *a_,const void *b_) +{ +const TSortData *a=a_; +const TSortData *b=b_; + +return a->nOrder-b->nOrder; +} + static TSort *prepare(pool *p,TSortData *pItems,int nItems) { TSort *pData=ap_palloc(p,nItems*sizeof *pData); int n; +qsort(pItems,nItems,sizeof *pItems,crude_order); for(n=0 ; n < nItems ; ++n) { pData[n].nPredecessors=0; 1.7 +13 -2 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ap_hooks.h1999/07/11 16:42:23 1.6 +++ ap_hooks.h1999/07/11 16:54:02 1.7 @@ -3,7 +3,8 @@ #define DECLARE_HOOK(ret,name,args) \ typedef ret HOOK_##name args; \ -void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre,const char * const *aszSucc); \ +void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \ + const char * const *aszSucc,int nOrder); \ ret ap_run_##name args; \ typedef struct _LINK_##name \ { \ @@ -11,6 +12,7 @@ const char *szName; \ const char * const *aszPredecessors; \ const char * const *aszSuccessors; \ +int nOrder; \ } LINK_##name; #define HOOK_STRUCT(members) \ @@ -20,7 +22,8 @@ array_header *link_##name; #define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,term1,term2,rv_final) \ -void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre,const char * const *aszSucc) \ +void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \ + const char * const *aszSucc,int nOrder) \ { \ LINK_##name *pHook; \ if(!_hooks.link_##name) \ @@ -32,6 +35,7 @@ pHook->pFunc=pf; \ pHook->aszPredecessors=aszPre; \ pHook->aszSuccessors=aszSucc; \ +pHook->nOrder=nOrder; \ pHook->szName=g_szCurrentHookName; \ if(g_bDebugHooks) \ ap_show_hook(#name,aszPre,aszSucc); \ @@ -63,6 +67,13 @@ IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all ? ok : decline) #define IMPLEMENT_VOID_HOOK(name,args,args2,run_all) \ IMPLEMENT_HOOK_BASE(voidname,args,args2,run_all,1,0,) + + /* Hook orderings */ +#define HOOK_REALLY_FIRST(-10) +#define HOOK_FIRST 0 +#define HOOK_MIDDLE 10 +#define HOOK_LAST20 +#define HOOK_REALLY_LAST 30 extern pool *g_pHookPool; extern int g_bDebugHooks; 1.5 +1 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_core.c 1999/07/11 13:27:25 1.4 +++ http_core.c 1999/07/11 16:54:04 1.5 @@ -2631,7 +2631,7 @@ static void register_hooks() { -ap_hook_translate_name(core_translate,NULL,NULL); +ap_hook_translate_name(core_translate,NULL,NULL,HOOK_REALLY_LAST); } API_VAR_EXPORT module core_module = { 1.5 +1 -1 apache-2.0/mpm/src/modules/standard/mod_alias.c Index: mod_alias.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_alias.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mod_alias.c 1999/07/11 13:27:28 1.4 +++ mod_alias.c 1999/07/11 16:54:08 1.5 @@ -399,7 +399,7 @@ { static const char * const aszPre[]={ "mod_userdir.c",NULL };
cvs commit: apache-2.0/mpm/src/main http_config.c http_connection.c http_protocol.c http_request.c
ben 99/07/11 09:42:25 Modified:mpm/src/include ap_hooks.h mpm/src/main http_config.c http_connection.c http_protocol.c http_request.c Log: Make run_all symbolic. Revision ChangesPath 1.6 +3 -0 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ap_hooks.h1999/07/11 13:27:24 1.5 +++ ap_hooks.h1999/07/11 16:42:23 1.6 @@ -56,6 +56,9 @@ return rv_final; \ } +#define RUN_ALL 1 +#define RUN_TO_FIRST_ERROR 0 + #define IMPLEMENT_HOOK(ret,name,args,args2,run_all,ok,decline) \ IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all ? ok : decline) #define IMPLEMENT_VOID_HOOK(name,args,args2,run_all) \ 1.9 +1 -1 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- http_config.c 1999/07/11 13:27:25 1.8 +++ http_config.c 1999/07/11 16:42:23 1.9 @@ -389,7 +389,7 @@ return run_method(r, offsets_into_method_ptrs.logger, 1); } -IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),1,OK,DECLINED) +IMPLEMENT_HOOK(int,header_parser,(request_rec *r),(r),RUN_ALL,OK,DECLINED) /* Auth stuff --- anything that defines one of these will presumably * want to define something for the other. Note that check_auth is 1.10 +1 -1 apache-2.0/mpm/src/main/http_connection.c Index: http_connection.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_connection.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- http_connection.c 1999/07/07 15:31:58 1.9 +++ http_connection.c 1999/07/11 16:42:24 1.10 @@ -68,7 +68,7 @@ HOOK_LINK(pre_connection) ); -IMPLEMENT_VOID_HOOK(pre_connection,(conn_rec *c),(c),1) +IMPLEMENT_VOID_HOOK(pre_connection,(conn_rec *c),(c),RUN_ALL) /* TODO: re-implement the lingering close stuff */ #define NO_LINGCLOSE 1.11 +1 -1 apache-2.0/mpm/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_protocol.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- http_protocol.c 1999/07/11 14:49:04 1.10 +++ http_protocol.c 1999/07/11 16:42:24 1.11 @@ -2688,4 +2688,4 @@ ap_finalize_request_protocol(r); } -IMPLEMENT_HOOK(int,post_read_request,(request_rec *r),(r),1,OK,DECLINED) +IMPLEMENT_HOOK(int,post_read_request,(request_rec *r),(r),RUN_ALL,OK,DECLINED) 1.9 +2 -1 apache-2.0/mpm/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- http_request.c1999/07/11 13:27:25 1.8 +++ http_request.c1999/07/11 16:42:24 1.9 @@ -82,7 +82,8 @@ HOOK_LINK(translate_name) ) -IMPLEMENT_HOOK(int,translate_name,(request_rec *r),(r),0,OK,DECLINED) +IMPLEMENT_HOOK(int,translate_name,(request_rec *r),(r),RUN_TO_FIRST_ERROR,OK, +DECLINED) /* *
cvs commit: apache-2.0/mpm/src/modules/standard Makefile.tmpl
ben 99/07/11 09:36:52 Modified:mpm/src/ap Makefile.tmpl mpm/src/main Makefile.tmpl mpm/src/modules/standard Makefile.tmpl Log: make depend. Revision ChangesPath 1.7 +5 -0 apache-2.0/mpm/src/ap/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/Makefile.tmpl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Makefile.tmpl 1999/07/11 13:27:23 1.6 +++ Makefile.tmpl 1999/07/11 16:36:50 1.7 @@ -58,6 +58,11 @@ ap_getpass.o: ap_getpass.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ $(INCDIR)/ap_ctype.h $(INCDIR)/ap.h $(INCDIR)/apr.h +ap_hooks.o: ap_hooks.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ + $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ + $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ + $(INCDIR)/apr.h $(INCDIR)/util_uri.h $(INCDIR)/ap_hooks.h ap_md5c.o: ap_md5c.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ $(INCDIR)/ap_ctype.h $(INCDIR)/ap_md5.h $(INCDIR)/ap.h \ 1.12 +8 -1 apache-2.0/mpm/src/main/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/Makefile.tmpl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Makefile.tmpl 1999/07/06 21:32:09 1.11 +++ Makefile.tmpl 1999/07/11 16:36:51 1.12 @@ -64,7 +64,6 @@ $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ $(INCDIR)/apr.h $(INCDIR)/util_uri.h $(INCDIR)/http_log.h \ $(INCDIR)/ap_mpm.h -ap_hooks.o: ap_hooks.c buff.o: buff.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ @@ -154,6 +153,14 @@ $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ $(INCDIR)/apr.h $(INCDIR)/util_uri.h $(INCDIR)/http_config.h \ $(INCDIR)/ap_hooks.h $(INCDIR)/ap_listen.h $(INCDIR)/http_log.h +mpm_prefork.o: mpm_prefork.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ + $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ + $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ + $(INCDIR)/apr.h $(INCDIR)/util_uri.h $(INCDIR)/http_main.h \ + $(INCDIR)/http_log.h $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ + $(INCDIR)/http_core.h $(INCDIR)/http_connection.h \ + $(INCDIR)/scoreboard_prefork.h rfc1413.o: rfc1413.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ 1.6 +5 -3 apache-2.0/mpm/src/modules/standard/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/Makefile.tmpl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Makefile.tmpl 1999/07/06 21:32:18 1.5 +++ Makefile.tmpl 1999/07/11 16:36:51 1.6 @@ -29,7 +29,8 @@ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h \ - $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h + $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ + $(INCDIR)/http_request.h mod_asis.o: mod_asis.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h \ $(OSDIR)/os.h $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ @@ -266,7 +267,7 @@ $(INCDIR)/http_core.h $(INCDIR)/http_protocol.h \ $(INCDIR)/http_conf_globals.h $(INCDIR)/http_main.h \ $(INCDIR)/util_script.h $(INCDIR)/scoreboard.h \ - /usr/include/pthread.h $(INCDIR)/http_log.h + $(INCDIR)/http_log.h mod_unique_id.o: mod_unique_id.c $(INCDIR)/httpd.h \ $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ @@ -281,7 +282,8 @@ $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h \ $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h \ - $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h + $(INCDIR)/http_config.h $(INCDIR)/ap_hooks.h \ + $(INCDIR)/http_request.h mod_usertrack.o: mod_usertrack.c $(INCDIR)/httpd.h \ $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/07/11 06:27:32 Modified:mpm/src/ap Makefile.tmpl mpm/src/include ap_hooks.h http_config.h http_request.h mpm/src/main http_config.c http_core.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Added: mpm/src/ap ap_hooks.c Log: Add topological sorting to hook ordering. Revision ChangesPath 1.6 +1 -1 apache-2.0/mpm/src/ap/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/Makefile.tmpl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Makefile.tmpl 1999/06/29 09:00:06 1.5 +++ Makefile.tmpl 1999/07/11 13:27:23 1.6 @@ -6,7 +6,7 @@ LIB=libap.a OBJS=ap_cpystrn.o ap_execve.o ap_fnmatch.o ap_getpass.o ap_md5c.o ap_signal.o \ - ap_slack.o ap_snprintf.o ap_buf.o + ap_slack.o ap_snprintf.o ap_buf.o ap_hooks.o .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $< 1.1 apache-2.0/mpm/src/ap/ap_hooks.c Index: ap_hooks.c === #include "httpd.h" #include "ap_hooks.h" #include #if 0 #define ap_palloc(pool,size) malloc(size) #endif /* NB: This must echo the LINK_##name structure */ typedef struct { void (*dummy)(void *); const char *szName; const char * const *aszPredecessors; const char * const *aszSuccessors; } TSortData; typedef struct tsort_ { void *pData; int nPredecessors; struct tsort_ **ppPredecessors; struct tsort_ *pNext; } TSort; static TSort *prepare(pool *p,TSortData *pItems,int nItems) { TSort *pData=ap_palloc(p,nItems*sizeof *pData); int n; for(n=0 ; n < nItems ; ++n) { pData[n].nPredecessors=0; pData[n].ppPredecessors=ap_palloc(p,nItems*sizeof *pData[n].ppPredecessors); pData[n].pNext=NULL; pData[n].pData=&pItems[n]; } for(n=0 ; n < nItems ; ++n) { int i,k; for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) for(k=0 ; k < nItems ; ++k) if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { int l; for(l=0 ; l < pData[n].nPredecessors ; ++l) if(pData[n].ppPredecessors[l] == &pData[k]) goto got_it; pData[n].ppPredecessors[pData[n].nPredecessors]=&pData[k]; ++pData[n].nPredecessors; got_it: break; } for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) for(k=0 ; k < nItems ; ++k) if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { int l; for(l=0 ; l < pData[k].nPredecessors ; ++l) if(pData[k].ppPredecessors[l] == &pData[n]) goto got_it2; pData[k].ppPredecessors[pData[k].nPredecessors]=&pData[n]; ++pData[k].nPredecessors; got_it2: break; } } return pData; } static TSort *tsort(TSort *pData,int nItems) { int nTotal; TSort *pHead=NULL; TSort *pTail=NULL; for(nTotal=0 ; nTotal < nItems ; ++nTotal) { int n,i,k; for(n=0 ; ; ++n) { if(n == nItems) assert(0); // we have a loop... if(!pData[n].pNext && !pData[n].nPredecessors) break; } if(pTail) pTail->pNext=&pData[n]; else pHead=&pData[n]; pTail=&pData[n]; pTail->pNext=pTail; // fudge it so it looks linked for(i=0 ; i < nItems ; ++i) for(k=0 ; pData[i].ppPredecessors[k] ; ++k) if(pData[i].ppPredecessors[k] == &pData[n]) { --pData[i].nPredecessors; break; } } pTail->pNext=NULL;// unfudge the tail return pHead; } static array_header *sort_hook(array_header *pHooks,const char *szName) { pool *p=ap_make_sub_pool(g_pHookPool); TSort *pSort; array_header *p
cvs commit: apache-2.0/mpm/src/include ap_hooks.h
ben 99/07/10 11:58:17 Modified:mpm/src/include ap_hooks.h Log: Use arrays for hooks. Revision ChangesPath 1.4 +12 -7 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ap_hooks.h1999/07/10 13:32:46 1.3 +++ ap_hooks.h1999/07/10 18:58:17 1.4 @@ -10,33 +10,38 @@ typedef struct _LINK_##name \ { \ HOOK_##name *pFunc; \ -struct _LINK_##name *pNext; \ } LINK_##name; #define HOOK_STRUCT(members) \ static struct { members } _hooks; #define HOOK_LINK(name) \ -LINK_##name *link_##name; +array_header *link_##name; #define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,term1,term2,rv_final) \ void ap_hook_##name(HOOK_##name *pf) \ { \ -LINK_##name *pHook=ap_palloc(g_pHookPool,sizeof(LINK_##name)); \ -pHook->pNext=_hooks.link_##name; \ +LINK_##name *pHook; \ +if(!_hooks.link_##name) \ + _hooks.link_##name=ap_make_array(g_pHookPool,1,sizeof(LINK_##name)); \ +pHook=ap_push_array(_hooks.link_##name); \ pHook->pFunc=pf; \ -_hooks.link_##name=pHook; \ if(g_bDebugHooks) \ puts(" Hooked " #name); \ } \ ret ap_run_##name args \ { \ LINK_##name *pHook; \ +int n; \ rv_decl \ +\ +if(!_hooks.link_##name) \ + return rv_final; \ \ -for(pHook=_hooks.link_##name ; pHook ; pHook=pHook->pNext) \ +pHook=(LINK_##name *)_hooks.link_##name->elts; \ +for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - sv pHook->pFunc args2; \ + sv pHook[n].pFunc args2; \ \ if(term1 && (!run_all || term2)) \ return rv; \
cvs commit: apache-2.0/mpm/src/main http_config.c http_main.c
ben 99/07/10 06:32:48 Modified:mpm/src/include ap_hooks.h mpm/src/main http_config.c http_main.c Log: Rudimentary debugging for hooks. Revision ChangesPath 1.3 +4 -0 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ap_hooks.h1999/07/06 21:32:08 1.2 +++ ap_hooks.h1999/07/10 13:32:46 1.3 @@ -1,6 +1,8 @@ #ifndef APACHE_AP_HOOKS_H #define APACHE_AP_HOOKS_H +extern int g_bDebugHooks; + #define DECLARE_HOOK(ret,name,args) \ typedef ret HOOK_##name args; \ void ap_hook_##name(HOOK_##name *pf); \ @@ -24,6 +26,8 @@ pHook->pNext=_hooks.link_##name; \ pHook->pFunc=pf; \ _hooks.link_##name=pHook; \ +if(g_bDebugHooks) \ + puts(" Hooked " #name); \ } \ ret ap_run_##name args \ { \ 1.7 +16 -2 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- http_config.c 1999/07/06 21:32:10 1.6 +++ http_config.c 1999/07/10 13:32:47 1.7 @@ -529,6 +529,21 @@ return HTTP_INTERNAL_SERVER_ERROR; } +int g_bDebugHooks; + +static void register_hooks(module *m) +{ +if(m->register_hooks) + { + if(ap_exists_config_define("SHOW_HOOKS")) + { + printf("Registering hooks for %s\n",m->name); + g_bDebugHooks=1; + } + m->register_hooks(); + } +} + /* One-time setup for precompiled modules --- NOT to be done on restart */ API_EXPORT(void) ap_add_module(module *m) @@ -582,8 +597,7 @@ #endif /*_OSD_POSIX*/ /* FIXME: is this the right place to call this? */ -if(m->register_hooks) - m->register_hooks(); +register_hooks(m); } /* 1.4 +15 -6 apache-2.0/mpm/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_main.c 1999/07/05 13:00:45 1.3 +++ http_main.c 1999/07/10 13:32:47 1.4 @@ -247,6 +247,7 @@ pool *ptemp; /* Pool for temporart config stuff */ pool *pcommands; /* Pool for -C and -c switches */ extern char *optarg; +extern int optind,optreset; /* TODO: PATHSEPARATOR should be one of the os defines */ @@ -264,14 +265,26 @@ pglobal = ap_init_alloc(); g_pHookPool=pglobal; -ap_setup_prelinked_modules(); - pcommands = ap_make_sub_pool(pglobal); ap_server_pre_read_config = ap_make_array(pcommands, 1, sizeof(char *)); ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *)); ap_server_config_defines = ap_make_array(pcommands, 1, sizeof(char *)); + +while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:th")) != -1) { +char **new; +switch (c) { + case 'D': + new = (char **)ap_push_array(ap_server_config_defines); + *new = ap_pstrdup(pcommands, optarg); + break; + } +} + +ap_setup_prelinked_modules(); + ap_pre_command_line_hook(pcommands); +optind=optreset=1; while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:th")) != -1) { char **new; switch (c) { @@ -281,10 +294,6 @@ break; case 'C': new = (char **)ap_push_array(ap_server_pre_read_config); - *new = ap_pstrdup(pcommands, optarg); - break; - case 'D': - new = (char **)ap_push_array(ap_server_config_defines); *new = ap_pstrdup(pcommands, optarg); break; case 'd':
Re: cvs commit: apache-1.3 STATUS
[EMAIL PROTECTED] wrote: > > coar99/07/07 04:05:16 > > Modified:.STATUS > Log: > Veto EAPI for 1.3.7 (too much confusion and controversy, esp. > with the KEAPI alternative); defer it until the next release. > Also note some platforms I can build. Note that I am introducing further confusion by replacing the entire module callback API with hooks in MPM. There are various reasons I haven't used either EAPI or KEAPI but here's the highlights: a) efficiency b) 100% typesafeness c) entanglement with SSL (in at least KEAPI's case) d) somewhat different motivation: I want to replace the whole callback API and allow protocol independence e) I need a way to allow modules to specify ordering, which (AFAIK) neither EAPI or KEAPI had f) The first great virtue of a programmer, laziness: as has been observed, writing the hooking stuff isn't that hard. It was easier for me to start again than to figure out how to hack things to get where I want to go. g) I was kind of hoping that people might contribute if I do it a piece at a time, thus getting something everyone is happy with. It is my opinion that extending the API in 1.3.x is a pointless distraction of effort. I invite interested parties to look at what I'm doing in MPM before its too late. BTW, the implementation of these hooks currently uses the preprocessor, which is rapidly getting ugly. I'm strongly considering writing a custom hook compiler to keep things readable, so please don't criticise on the grounds that you don't like the preprocesser messiness. Cheers, Ben. -- http://www.apache-ssl.org/ben.html "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi
cvs commit: apache-2.0/mpm/src/os/unix Makefile.tmpl
ben 99/07/06 14:32:31 Modified:mpm/src Makefile.tmpl mpm/src/include ap_hooks.h http_config.h http_protocol.h mpm/src/main Makefile.tmpl alloc.c http_config.c http_connection.c http_core.c http_protocol.c http_request.c rfc1413.c mpm/src/modules/mpm/prefork Makefile.tmpl prefork.c mpm/src/modules/standard Makefile.tmpl mod_access.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c mpm/src/os/unix Makefile.tmpl Log: More hooky stuff. Revision ChangesPath 1.5 +1 -1 apache-2.0/mpm/src/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/Makefile.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.tmpl 1999/06/29 09:00:04 1.4 +++ Makefile.tmpl 1999/07/06 21:32:07 1.5 @@ -129,4 +129,4 @@ include/ap_mmn.h include/ap_config_auto.h os/unix/os.h \ os/unix/os-inline.c include/ap_ctype.h include/alloc.h include/buff.h \ include/ap_iol.h include/ap.h include/apr.h include/util_uri.h \ - include/http_config.h + include/http_config.h include/ap_hooks.h 1.2 +15 -9 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ap_hooks.h1999/07/05 13:00:42 1.1 +++ ap_hooks.h1999/07/06 21:32:08 1.2 @@ -1,6 +1,10 @@ +#ifndef APACHE_AP_HOOKS_H +#define APACHE_AP_HOOKS_H + #define DECLARE_HOOK(ret,name,args) \ typedef ret HOOK_##name args; \ -void hook_##name(HOOK_##name *pf); \ +void ap_hook_##name(HOOK_##name *pf); \ +ret ap_run_##name args; \ typedef struct _LINK_##name \ { \ HOOK_##name *pFunc; \ @@ -13,15 +17,15 @@ #define HOOK_LINK(name) \ LINK_##name *link_##name; -#define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,terminate) \ -void hook_##name(HOOK_##name *pf) \ +#define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,term1,term2,rv_final) \ +void ap_hook_##name(HOOK_##name *pf) \ { \ LINK_##name *pHook=ap_palloc(g_pHookPool,sizeof(LINK_##name)); \ pHook->pNext=_hooks.link_##name; \ pHook->pFunc=pf; \ _hooks.link_##name=pHook; \ } \ -ret run_##name args \ +ret ap_run_##name args \ { \ LINK_##name *pHook; \ rv_decl \ @@ -30,15 +34,17 @@ { \ sv pHook->pFunc args2; \ \ - if(!run_all terminate) \ + if(term1 && (!run_all || term2)) \ return rv; \ } \ -return rv; \ +return rv_final; \ } -#define IMPLEMENT_HOOK(ret,name,args,args2,run_all,finish) \ - IMPLEMENT_HOOK_BASE(ret,ret r;,r=,r,name,args,args2,run_all,&& r == finish) +#define IMPLEMENT_HOOK(ret,name,args,args2,run_all,ok,decline) \ + IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all ? ok : decline) #define IMPLEMENT_VOID_HOOK(name,args,args2,run_all) \ - IMPLEMENT_HOOK_BASE(voidname,args,args2,run_all,) + IMPLEMENT_HOOK_BASE(voidname,args,args2,run_all,1,0,) extern pool *g_pHookPool; + +#endif /* ndef(AP_HOOKS_H) */ 1.5 +5 -6 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_config.h 1999/07/05 13:00:42 1.4 +++ http_config.h 1999/07/06 21:32:08 1.5 @@ -58,6 +58,8 @@ #ifndef APACHE_HTTP_CONFIG_H #define APACHE_HTTP_CONFIG_H +#include "ap_hooks.h" + #ifdef __cplusplus extern "C" { #endif @@ -236,8 +238,6 @@ * type_checker --- Determine MIME type of the requested entity; * sets content_type, _encoding and _language fields. * logger --- log a transaction. - * post_read_request --- run right after read_request or internal_redirect, - * and not run during any subrequests. */ int (*translate_handler) (request_rec *); @@ -247,8 +247,6 @@ int (*type_checker) (request_rec *); int (*fixer_upper) (request_rec *); int (*logger) (request_rec *); -int (*header_parser) (r
cvs commit: apache-2.0/mpm/src/main http_config.c http_connection.c http_main.c
ben 99/07/05 06:00:47 Modified:mpm/src CHANGES mpm/src/include http_config.h http_connection.h mpm/src/main http_config.c http_connection.c http_main.c Added: mpm/src/include ap_hooks.h Log: Strawman hooks implementation (beginning of). Revision ChangesPath 1.12 +7 -0 apache-2.0/mpm/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-2.0/mpm/src/CHANGES,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- CHANGES 1999/06/24 01:57:43 1.11 +++ CHANGES 1999/07/05 13:00:39 1.12 @@ -1,5 +1,12 @@ Changes with MPM +* Start to implement module-defined hooks that are a) fast and b) typesafe. + Replace pre_connection module call with a register_hook call and + implement pre_connection as a hook. The intent is that these hooks will + be extended to allow Apache to be multi-protocol, and also to allow the + calling order to be specified on a per-hook/per-module basis. + [Ben Laurie] + * Implement mpm_* methods as "modules". Each method gets it's own subdir in src/modules (eg: src/modules/prefork). Selection of method uses Rule MPM_METHOD. [Jim Jagielski] 1.4 +1 -1 apache-2.0/mpm/src/include/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_config.h 1999/06/29 09:00:08 1.3 +++ http_config.h 1999/07/05 13:00:42 1.4 @@ -249,7 +249,7 @@ int (*logger) (request_rec *); int (*header_parser) (request_rec *); int (*post_read_request) (request_rec *); -int (*pre_connection) (conn_rec *); +void (*register_hooks) (void); } module; /* Initializer for the first few module slots, which are only 1.4 +5 -0 apache-2.0/mpm/src/include/http_connection.h Index: http_connection.h === RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_connection.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_connection.h 1999/07/02 18:22:24 1.3 +++ http_connection.h 1999/07/05 13:00:42 1.4 @@ -58,6 +58,8 @@ #ifndef APACHE_HTTP_CONNECTION_H #define APACHE_HTTP_CONNECTION_H +#include "ap_hooks.h" + #ifdef __cplusplus extern "C" { #endif @@ -67,6 +69,9 @@ const struct sockaddr_in *saddr, int child_num, int thread_num); CORE_EXPORT(void) ap_process_connection(conn_rec *); + + /* Hooks */ +DECLARE_HOOK(void,pre_connection,(conn_rec *)) #ifdef __cplusplus } 1.1 apache-2.0/mpm/src/include/ap_hooks.h Index: ap_hooks.h === #define DECLARE_HOOK(ret,name,args) \ typedef ret HOOK_##name args; \ void hook_##name(HOOK_##name *pf); \ typedef struct _LINK_##name \ { \ HOOK_##name *pFunc; \ struct _LINK_##name *pNext; \ } LINK_##name; #define HOOK_STRUCT(members) \ static struct { members } _hooks; #define HOOK_LINK(name) \ LINK_##name *link_##name; #define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,terminate) \ void hook_##name(HOOK_##name *pf) \ { \ LINK_##name *pHook=ap_palloc(g_pHookPool,sizeof(LINK_##name)); \ pHook->pNext=_hooks.link_##name; \ pHook->pFunc=pf; \ _hooks.link_##name=pHook; \ } \ ret run_##name args \ { \ LINK_##name *pHook; \ rv_decl \ \ for(pHook=_hooks.link_##name ; pHook ; pHook=pHook->pNext) \ { \ sv pHook->pFunc args2; \ \ if(!run_all terminate) \ return rv; \ } \ return rv; \ } #define IMPLEMENT_HOOK(ret,name,args,args2,run_all,finish) \ IMPLEMENT_HOOK_BASE(ret,ret r;,r=,r,name,args,args2,run_all,&& r == finish) #define IMPLEMENT_VOID_HOOK(name,args,args2,run_all) \ IMPLEMENT_HOOK_BASE(voidname,args,args2,run_all,) extern pool *g_pHookPool; 1.5 +5 -9 apache-2.0/mpm/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_config.c 1999/06/29 09:00:16 1.4 +++ http_config.c 1999/07/05 13:00:44 1.5 @@ -281,8 +281,7 @@ XtOffsetOf(module, fixer_upper), XtOffsetOf(m
cvs commit: apache-2.0/mpm/src/os/unix Makefile.tmpl
ben 99/06/29 02:00:32 Modified:mpm/src Makefile.tmpl mpm/src/ap Makefile.tmpl mpm/src/include http_config.h http_connection.h httpd.h mpm/src/main Makefile.tmpl http_config.c http_connection.c mpm/src/modules/mpm/prefork Makefile.tmpl prefork.c mpm/src/modules/standard Makefile.tmpl mpm/src/os/unix Makefile.tmpl Log: New API for I/O layering, and dependency updates. Revision ChangesPath 1.4 +5 -6 apache-2.0/mpm/src/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/Makefile.tmpl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Makefile.tmpl 1999/06/20 23:14:29 1.3 +++ Makefile.tmpl 1999/06/29 09:00:04 1.4 @@ -123,11 +123,10 @@ # DO NOT REMOVE buildmark.o: buildmark.c include/ap_config.h include/ap_mmn.h \ include/ap_config_auto.h os/unix/os.h os/unix/os-inline.c \ - include/ap_ctype.h include/hsregex.h include/httpd.h include/alloc.h \ - include/buff.h include/ap_iol.h include/ap.h include/apr.h \ - include/util_uri.h + include/ap_ctype.h include/httpd.h include/alloc.h include/buff.h \ + include/ap_iol.h include/ap.h include/apr.h include/util_uri.h modules.o: modules.c include/httpd.h include/ap_config.h \ include/ap_mmn.h include/ap_config_auto.h os/unix/os.h \ - os/unix/os-inline.c include/ap_ctype.h include/hsregex.h \ - include/alloc.h include/buff.h include/ap_iol.h include/ap.h \ - include/apr.h include/util_uri.h include/http_config.h + os/unix/os-inline.c include/ap_ctype.h include/alloc.h include/buff.h \ + include/ap_iol.h include/ap.h include/apr.h include/util_uri.h \ + include/http_config.h 1.5 +20 -22apache-2.0/mpm/src/ap/Makefile.tmpl Index: Makefile.tmpl === RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/Makefile.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.tmpl 1999/06/20 23:14:30 1.4 +++ Makefile.tmpl 1999/06/29 09:00:06 1.5 @@ -41,41 +41,39 @@ # DO NOT REMOVE ap_buf.o: ap_buf.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap_buf.h + $(INCDIR)/ap_ctype.h $(INCDIR)/ap_buf.h ap_cpystrn.o: ap_cpystrn.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ - $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ - $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ - $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ + $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ + $(INCDIR)/apr.h $(INCDIR)/util_uri.h ap_execve.o: ap_execve.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ - $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ - $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ - $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ + $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ + $(INCDIR)/apr.h $(INCDIR)/util_uri.h ap_fnmatch.o: ap_fnmatch.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/fnmatch.h + $(INCDIR)/ap_ctype.h $(INCDIR)/fnmatch.h ap_getpass.o: ap_getpass.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap.h \ - $(INCDIR)/apr.h + $(INCDIR)/ap_ctype.h $(INCDIR)/ap.h $(INCDIR)/apr.h ap_md5c.o: ap_md5c.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \ - $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap_md5.h \ - $(INCDIR)/ap.h $(INCDIR)/apr.h + $(INCDIR)/ap_ctype.h $(INCDIR)/ap_md5.h $(INCDIR)/ap.h \ + $(INCDIR)/apr.h ap_signal.o: ap_signal.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ - $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ - $(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap_iol.h \ - $(INCDIR)/ap.h $(INCDIR)/apr.h $(INCDIR)/util_uri.h + $(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/alloc.h \ + $(INCDIR)/buff.h $(INCDIR)/ap_iol.h $(INCDIR)/ap.h \ + $(INCDIR)/apr.h $(INCDIR)/util_uri.h ap_slack.o: ap_slack.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h
cvs commit: apache-2.0/mpm/src/modules/mpm/prefork prefork.c
ben 99/06/26 05:25:37 Modified:mpm/src/modules/mpm/prefork prefork.c Log: If last_lr is the last listener, then lr can start out NULL. Revision ChangesPath 1.5 +2 -2 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- prefork.c 1999/06/25 01:25:11 1.4 +++ prefork.c 1999/06/26 12:25:36 1.5 @@ -2190,11 +2190,11 @@ lr = last_lr->next; } while (lr != last_lr) { - if (FD_ISSET(lr->fd, &main_fds)) break; - lr = lr->next; if (!lr) { lr = ap_listeners; } + if (FD_ISSET(lr->fd, &main_fds)) break; + lr = lr->next; } if (lr == last_lr) { continue;