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
cvs commit: apache-2.0/src/os/unix iol_socket.c unixd.c
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. Revision ChangesPath 1.10 +1 -0 apache-2.0/src/ap/ap_hooks.c Index: ap_hooks.c === RCS file: /home/cvs/apache-2.0/src/ap/ap_hooks.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ap_hooks.c2000/01/19 01:14:22 1.9 +++ ap_hooks.c2000/01/28 18:00:33 1.10 @@ -1,3 +1,4 @@ +#include ap_config.h #include httpd.h #include ap_hooks.h #include assert.h 1.4 +1 -1 apache-2.0/src/ap/ap_sha1.c Index: ap_sha1.c === RCS file: /home/cvs/apache-2.0/src/ap/ap_sha1.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ap_sha1.c 2000/01/19 01:14:22 1.3 +++ ap_sha1.c 2000/01/28 18:00:35 1.4 @@ -84,13 +84,13 @@ #include string.h +#include ap_config.h #include httpd.h #include ap_sha1.h #include ap.h #ifdef CHARSET_EBCDIC #include ebcdic.h #endif /*CHARSET_EBCDIC*/ -#include ap_config.h /* a bit faster bigger, if defined */ #define UNROLL_LOOPS 1.3 +1 -0 apache-2.0/src/helpers/build-modules-c.awk Index: build-modules-c.awk === RCS file: /home/cvs/apache-2.0/src/helpers/build-modules-c.awk,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- build-modules-c.awk 1999/12/19 16:36:49 1.2 +++ build-modules-c.awk 2000/01/28 18:00:46 1.3 @@ -17,6 +17,7 @@ print * configuration script. DO NOT HAND EDIT! print */ print +print #include \ap_config.h\ print #include \httpd.h\ print #include \http_config.h\ print 1.29 +1 -1 apache-2.0/src/main/buff.c Index: buff.c === RCS file: /home/cvs/apache-2.0/src/main/buff.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- buff.c2000/01/23 16:37:39 1.28 +++ buff.c2000/01/28 18:00:58 1.29 @@ -55,10 +55,10 @@ * */ +#include ap_config.h #include httpd.h #include http_main.h #include http_log.h -#include ap_config.h #include stdio.h #include stdarg.h 1.2 +1 -0 apache-2.0/src/main/gen_test_char.c Index: gen_test_char.c === RCS file: /home/cvs/apache-2.0/src/main/gen_test_char.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- gen_test_char.c 1999/08/24 06:45:18 1.1 +++ gen_test_char.c 2000/01/28 18:01:04 1.2 @@ -1,4 +1,5 @@ /* we need some of the portability definitions... for strchr */ +#include ap_config.h #include httpd.h /* A bunch of functions in util.c scan strings looking for certain characters. 1.24 +1 -1 apache-2.0/src/main/http_config.c Index: http_config.c === RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- http_config.c 2000/01/19 01:15:02 1.23 +++ http_config.c 2000/01/28 18:01:06 1.24 @@ -72,6 +72,7 @@ #define CORE_PRIVATE +#include ap_config.h #include apr_portable.h #include apr_file_io.h #include httpd.h @@ -81,7 +82,6 @@ #include http_request.h/* for default_handler (see invoke_handler) */ #include http_main.h #include http_vhost.h -#include ap_config.h HOOK_STRUCT( HOOK_LINK(header_parser) 1.26 +1 -1 apache-2.0/src/main/http_connection.c Index: http_connection.c === RCS file: /home/cvs/apache-2.0/src/main/http_connection.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- http_connection.c 2000/01/19 01:15:03 1.25 +++
cvs commit: apache-2.0/src/os/unix iol_socket.c
manoj 99/11/29 18:53:14 Modified:src/os/unix iol_socket.c Log: Eliminate some warnings. Revision ChangesPath 1.12 +3 -5 apache-2.0/src/os/unix/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -u -r1.11 -r1.12 --- iol_socket.c 1999/11/15 19:50:31 1.11 +++ iol_socket.c 1999/11/30 02:53:12 1.12 @@ -86,8 +86,6 @@ static ap_status_t unix_getopt(ap_iol *viol, ap_iol_option opt, void *value) { -iol_socket *iol = (iol_socket *)viol; - switch (opt) { case AP_IOL_TIMEOUT: /* no-op */ @@ -99,21 +97,21 @@ } -ap_status_t unix_write(ap_iol *viol, const char* buf, ap_size_t size, +static ap_status_t unix_write(ap_iol *viol, const char* buf, ap_size_t size, ap_ssize_t *nbytes) { *nbytes = size; return ap_send(((iol_socket *)viol)-sock, buf, nbytes); } -ap_status_t unix_writev(ap_iol *viol, const struct iovec *vec, int nvec, +static ap_status_t unix_writev(ap_iol *viol, const struct iovec *vec, int nvec, ap_ssize_t *nbytes) { *nbytes = vec[0].iov_len; return ap_send(((iol_socket *)viol)-sock, vec[0].iov_base, nbytes); } -ap_status_t unix_read(ap_iol *viol, char* buf, ap_size_t size, +static ap_status_t unix_read(ap_iol *viol, char* buf, ap_size_t size, ap_ssize_t *nbytes) { *nbytes = size;
cvs commit: apache-2.0/src/os/unix iol_socket.c
manoj 99/10/29 17:25:31 Modified:src/os/unix iol_socket.c Log: Fix a horrible bug causing all sorts of insanely weird file descriptor bugs. Both APR (during pool cleanup) and IOL (triggered by bclose) were trying to close the same socket. As a temporary hack, this patch makes the socket's iol_close a no-op, so that buff doesn't actually close the socket. Revision ChangesPath 1.10 +8 -0 apache-2.0/src/os/unix/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -u -r1.9 -r1.10 --- iol_socket.c 1999/10/26 05:29:40 1.9 +++ iol_socket.c 1999/10/30 00:25:31 1.10 @@ -207,6 +207,13 @@ static ap_status_t unix_close(ap_iol *viol) { + +/* XXX: This is a *temporary* ultra-hack solution to the double-close problem. + * APR and buff were both trying to close this socket */ + +return APR_SUCCESS; + +#if 0 iol_socket *iol = (iol_socket *)viol; int rv; int saved_errno; @@ -218,6 +225,7 @@ return APR_SUCCESS; } return saved_errno; +#endif } static const ap_iol_methods socket_methods = {
cvs commit: apache-2.0/src/os/unix iol_socket.c
manoj 99/10/25 22:29:40 Modified:src/os/unix iol_socket.c Log: Fix bugs in the big fat macro. Revision ChangesPath 1.9 +4 -3 apache-2.0/src/os/unix/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -u -r1.8 -r1.9 --- iol_socket.c 1999/10/25 21:01:08 1.8 +++ iol_socket.c 1999/10/26 05:29:40 1.9 @@ -148,6 +148,7 @@ rv = select(iol-fd + 1, selread, selwrite, NULL, iol-timeout 0 ? NULL : tv); \ } while (rv == -1 errno == EINTR); \ if (!FD_ISSET(iol-fd, fdset)) { \ +*nbytes = 0; \ return APR_ETIMEDOUT; \ } \ do { \ @@ -190,12 +191,12 @@ do { \ rv = syscall(iol-fd, arg1, arg2); \ } while (rv == -1 errno == EINTR); \ - if ((errno == EWOULDBLOCK || errno == EAGAIN) iol-timeout != 0) { \ - return unix_##name##_timeout(viol, arg1, arg2, nbytes); \ - } \ if (rv = 0) { \ *nbytes = rv; \ return APR_SUCCESS; \ + } \ + if ((errno == EWOULDBLOCK || errno == EAGAIN) iol-timeout != 0) { \ + return unix_##name##_timeout(viol, arg1, arg2, nbytes); \ } \ return errno; \ }
cvs commit: apache-2.0/src/os/unix iol_socket.c
manoj 99/10/25 14:00:33 Modified:src/os/unix iol_socket.c Log: We didn't zero out nbytes in one case of error; fix that. Revision ChangesPath 1.7 +1 -0 apache-2.0/src/os/unix/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -u -r1.6 -r1.7 --- iol_socket.c 1999/10/20 19:38:27 1.6 +++ iol_socket.c 1999/10/25 21:00:27 1.7 @@ -157,6 +157,7 @@ *nbytes = rv; \ return APR_SUCCESS; \ } \ +*nbytes = 0; \ return errno; \ \ } \
cvs commit: apache-2.0/src/os/unix iol_socket.c
manoj 99/10/25 14:01:09 Modified:src/os/unix iol_socket.c Log: Fix a misspelling in a comment Revision ChangesPath 1.8 +1 -1 apache-2.0/src/os/unix/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -u -r1.7 -r1.8 --- iol_socket.c 1999/10/25 21:00:27 1.7 +++ iol_socket.c 1999/10/25 21:01:08 1.8 @@ -167,7 +167,7 @@ iol_socket *iol = (iol_socket *)viol; \ int rv; \ \ -/* Present to zero until some bytes are actually written */ \ +/* Preset to zero until some bytes are actually written */ \ *nbytes = 0; \ if (!(iol-flags FD_NONBLOCKING_SET)) { \ if (iol-timeout 0) { \
cvs commit: apache-2.0/src/os/unix iol_socket.c
rse 99/08/28 05:22:12 Modified:src/main alloc.c buff.c http_connection.c http_main.c http_protocol.c src/os/unix iol_socket.c Log: Make ``configure --with-option=devel'' under GCC 2.95.1 happy by avoiding various warnings... Revision ChangesPath 1.7 +2 -0 apache-2.0/src/main/alloc.c Index: alloc.c === RCS file: /home/cvs/apache-2.0/src/main/alloc.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- alloc.c 1999/08/27 22:57:05 1.6 +++ alloc.c 1999/08/28 12:22:09 1.7 @@ -201,7 +201,9 @@ static union block_hdr *block_freelist = NULL; static ap_thread_mutex *alloc_mutex; +#ifdef WIN32 static ap_thread_mutex *spawn_mutex; /* Added back in for WIN32... */ +#endif #ifdef POOL_DEBUG static char *known_stack_point; 1.3 +1 -1 apache-2.0/src/main/buff.c Index: buff.c === RCS file: /home/cvs/apache-2.0/src/main/buff.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- buff.c1999/08/26 10:45:55 1.2 +++ buff.c1999/08/28 12:22:09 1.3 @@ -601,7 +601,7 @@ ap_assert(nbyte 0); if (fb-outcnt) { - vec[0].iov_base = fb-outbase; + vec[0].iov_base = (void *)fb-outbase; vec[0].iov_len = fb-outcnt; vec[1].iov_base = (void *)buf; vec[1].iov_len = nbyte; 1.18 +1 -1 apache-2.0/src/main/http_connection.c Index: http_connection.c === RCS file: /home/cvs/apache-2.0/src/main/http_connection.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- http_connection.c 1999/08/13 06:57:40 1.17 +++ http_connection.c 1999/08/28 12:22:09 1.18 @@ -67,7 +67,7 @@ HOOK_STRUCT( HOOK_LINK(pre_connection) HOOK_LINK(process_connection) -); +) IMPLEMENT_HOOK_VOID(pre_connection,(conn_rec *c),(c)) IMPLEMENT_HOOK_RUN_FIRST(int,process_connection,(conn_rec *c),(c),DECLINED) 1.4 +3 -1 apache-2.0/src/main/http_main.c Index: http_main.c === RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_main.c 1999/08/27 22:57:07 1.3 +++ http_main.c 1999/08/28 12:22:10 1.4 @@ -233,6 +233,9 @@ } pool *g_pHookPool; + +extern char *optarg; + #ifdef WIN32 __declspec(dllexport) int apache_main(int argc, char *argv[]) @@ -251,7 +254,6 @@ pool *plog; /* Pool for error-logging files */ pool *ptemp; /* Pool for temporart config stuff */ pool *pcommands; /* Pool for -C and -c switches */ -extern char *optarg; /* TODO: PATHSEPARATOR should be one of the os defines */ #define PATHSEPARATOR '/' 1.12 +1 -1 apache-2.0/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- http_protocol.c 1999/08/27 22:18:48 1.11 +++ http_protocol.c 1999/08/28 12:22:10 1.12 @@ -80,7 +80,7 @@ HOOK_LINK(log_transaction) HOOK_LINK(http_method) HOOK_LINK(default_port) -); +) #define SET_BYTES_SENT(r) \ do { if (r-sent_bodyct) \ 1.4 +1 -0 apache-2.0/src/os/unix/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- iol_socket.c 1999/08/13 15:52:01 1.3 +++ iol_socket.c 1999/08/28 12:22:12 1.4 @@ -58,6 +58,7 @@ #include httpd.h #include ap_iol.h +#include iol_socket.h #include errno.h #include sys/types.h