cvs commit: apache-2.0/src Configure
ronald 99/11/01 21:08:53 Modified:src Configure Log: get rid of error under solaris 2.6 Revision ChangesPath 1.16 +1 -1 apache-2.0/src/Configure Index: Configure === RCS file: /home/cvs/apache-2.0/src/Configure,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- Configure 1999/10/29 13:20:10 1.15 +++ Configure 1999/11/02 05:08:51 1.16 @@ -1735,7 +1735,7 @@ (cd lib/apr autoconf autoheader) fi echo + configuring Apache Portable Runtime (APR) -APR_FLAGS=`egrep ^APR_FLAGS= $file|sed -e 's/APR_FLAGS='//` +APR_FLAGS=`egrep '^APR_FLAGS=' $file|sed -e 's/APR_FLAGS='//` if [ x$APR_FLAGS != x ]; then echo o with flags: $APR_FLAGS fi
cvs commit: apache-2.0/src/lib/apr/threadproc/beos Makefile.in
dreid 99/11/02 03:30:39 Modified:src/lib/apr/locks/beos Makefile.in src/lib/apr/misc/beos Makefile.in src/lib/apr/network_io/beos Makefile.in sockets.c src/lib/apr/threadproc/beos Makefile.in Log: This primarily updates some dependancies and fixes a small problem with ap_null_cleanup. Revision ChangesPath 1.3 +8 -6 apache-2.0/src/lib/apr/locks/beos/Makefile.in Index: Makefile.in === RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/beos/Makefile.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Makefile.in 1999/08/27 16:25:37 1.2 +++ Makefile.in 1999/11/02 11:30:36 1.3 @@ -53,11 +53,13 @@ # DO NOT REMOVE crossproc.o: crossproc.c ../../include/apr_lock.h \ - ../../include/apr_general.h ../../include/apr_errno.h locks.h \ - ../../include/apr_file_io.h + ../../include/apr_general.h ../../include/apr_config.h \ + ../../include/apr_errno.h ../../include/apr_lib.h \ + ../../include/apr_file_io.h locks.h intraproc.o: intraproc.c ../../include/apr_lock.h \ - ../../include/apr_general.h ../../include/apr_errno.h locks.h \ - ../../include/apr_file_io.h -locks.o: locks.c ../../include/apr_lock.h \ - ../../include/apr_general.h ../../include/apr_errno.h locks.h \ + ../../include/apr_general.h ../../include/apr_config.h \ + ../../include/apr_errno.h locks.h ../../include/apr_file_io.h \ + ../../include/apr_lib.h +locks.o: locks.c ../../include/apr_lock.h ../../include/apr_general.h \ + ../../include/apr_config.h ../../include/apr_errno.h locks.h \ ../../include/apr_file_io.h 1.4 +7 -0 apache-2.0/src/lib/apr/misc/beos/Makefile.in Index: Makefile.in === RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/beos/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Makefile.in 1999/09/07 13:16:43 1.3 +++ Makefile.in 1999/11/02 11:30:37 1.4 @@ -50,3 +50,10 @@ rm Makefile.new # DO NOT REMOVE +getopt.o: getopt.c misc.h ../../include/apr_general.h \ + ../../include/apr_config.h ../../include/apr_errno.h \ + ../../include/apr_file_io.h +start.o: start.c ../../include/apr_config.h \ + ../../include/apr_general.h ../../include/apr_errno.h \ + $(INCDIR)/apr_pools.h ../../include/apr_lib.h \ + ../../include/apr_file_io.h misc.h 1.5 +19 -5 apache-2.0/src/lib/apr/network_io/beos/Makefile.in Index: Makefile.in === RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.in 1999/10/25 13:21:12 1.4 +++ Makefile.in 1999/11/02 11:30:37 1.5 @@ -54,12 +54,26 @@ rm Makefile.new # DO NOT REMOVE +inet_aton.o: inet_aton.c networkio.h ../../include/apr_general.h \ + ../../include/apr_config.h ../../include/apr_errno.h poll.o: poll.c networkio.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_network_io.h + ../../include/apr_config.h ../../include/apr_errno.h \ + ../../include/apr_network_io.h sendrecv.o: sendrecv.c networkio.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_network_io.h -socket.o: socket.c + ../../include/apr_config.h ../../include/apr_errno.h \ + ../../file_io/unix/fileio.h ../../include/apr_file_io.h \ + ../../include/apr_network_io.h +sockaddr.o: sockaddr.c networkio.h ../../include/apr_general.h \ + ../../include/apr_config.h ../../include/apr_errno.h \ + ../../include/apr_network_io.h ../../include/apr_lib.h \ + ../../include/apr_file_io.h sockets.o: sockets.c networkio.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_network_io.h + ../../include/apr_config.h ../../include/apr_errno.h \ + ../../include/apr_network_io.h ../../include/apr_portable.h \ + ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ + ../../include/apr_win.h ../../include/apr_lock.h \ + ../../include/apr_time.h ../../include/apr_lib.h sockopt.o: sockopt.c networkio.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_network_io.h + ../../include/apr_config.h ../../include/apr_errno.h \ + ../../include/apr_network_io.h ../../include/apr_lib.h \ + ../../include/apr_file_io.h 1.12 +1 -0 apache-2.0/src/lib/apr/network_io/beos/sockets.c Index: sockets.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/sockets.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 ---
cvs commit: apache-2.0/src/os/beos iol_socket.c iol_socket.h
dreid 99/11/02 04:26:43 Modified:src/modules/mpm/mpmt_beos mpmt_beos.c src/os/beos iol_socket.c iol_socket.h Log: Change the BeOS iol_socket layer to use apr. Also update mpmt_beos.c to reflect this change. Revision ChangesPath 1.7 +2 -6 apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c Index: mpmt_beos.c === RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- mpmt_beos.c 1999/10/28 22:14:54 1.6 +++ mpmt_beos.c 1999/11/02 12:26:41 1.7 @@ -643,11 +643,7 @@ long conn_id = my_child_num * HARD_THREAD_LIMIT + my_thread_num; int csd; -ap_get_os_sock(csd, sock); - -sock_disable_nagle(csd); - -iol = beos_attach_socket(csd); +iol = beos_attach_socket(sock); if (iol == NULL) { if (errno == EBADF) { ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, NULL, @@ -659,7 +655,7 @@ ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL, error attaching to socket); } -closesocket(csd); +ap_close_socket(sock); return; } 1.3 +26 -110 apache-2.0/src/os/beos/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/beos/iol_socket.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- iol_socket.c 1999/10/22 11:25:42 1.2 +++ iol_socket.c 1999/11/02 12:26:42 1.3 @@ -58,19 +58,15 @@ #include httpd.h #include ap_iol.h +#include apr_network_io.h +#include apr_file_io.h #include iol_socket.h -#include errno.h -#include sys/types.h -#include sys/uio.h - #define FD_NONBLOCKING_SET (1) typedef struct { ap_iol iol; -int fd; -int flags; -int timeout; +ap_socket_t *sock; } iol_socket; static ap_status_t beos_setopt(ap_iol *viol, ap_iol_option opt, @@ -80,10 +76,10 @@ switch (opt) { case AP_IOL_TIMEOUT: - iol-timeout = *(const int *)value; - break; +ap_setsocketopt(iol-sock, APR_SO_TIMEOUT, *(const int*)value); +break; default: - return APR_EINVAL; + return APR_EINVAL; } return APR_SUCCESS; } @@ -94,116 +90,42 @@ switch (opt) { case AP_IOL_TIMEOUT: - *(int *)value = iol-timeout; - break; + /* no-op */ + break; default: - return APR_EINVAL; + return APR_EINVAL; } return APR_SUCCESS; } -static ap_status_t set_nonblock(int fd) +ap_status_t beos_write(ap_iol *viol, const char* buf, ap_size_t size, + ap_ssize_t *nbytes) { -int on = 1; -int rv; -rv = setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, on, sizeof(int)); - -if (rv == 0) -return APR_SUCCESS; -return errno; +*nbytes = size; +return ap_send(((iol_socket *)viol)-sock, buf, nbytes); } - -/* the timeout code is a separate routine because it requires -a stack frame... and we don't want to pay that setup cost -on every call */ - -/* this macro expands into the four basic i/o methods */ - -#define method(name, args, syscall, selread, selwrite) \ -static ap_status_t beos_##name##_timeout args \ -{ \ - iol_socket *iol = (iol_socket *)viol; \ - fd_set fdset; \ - struct timeval tv; \ - int rv; \ - \ - FD_ZERO(fdset); \ - FD_SET(iol-fd, fdset); \ - tv.tv_sec = iol-timeout; \ - tv.tv_usec = 0; \ - do { \ - rv = select(iol-fd + 1, selread, selwrite, NULL, iol-timeout 0 ? NULL : tv); \ - } while (rv == -1 errno == EINTR); \ - if (!FD_ISSET(iol-fd, fdset)) { \ - return APR_ETIMEDOUT; \ - } \ - do { \ - rv = syscall(iol-fd, arg1, arg2, 0); \ - } while (rv == -1 errno == EINTR); \ -if (rv = 0) { \ -*nbytes = rv; \ -return APR_SUCCESS; \ -} \ - return errno; \ - \ -} \ - \ -static ap_status_t beos_##name args \ -{ \ - iol_socket *iol = (iol_socket *)viol; \ - int rv; \ - \ -/* Present to zero until some bytes are actually written */ \ -*nbytes = 0; \ - if (!(iol-flags FD_NONBLOCKING_SET)) { \ - if (iol-timeout 0) { \ - rv = syscall(iol-fd, arg1, arg2, 0); \ -if (rv = 0) { \ -*nbytes = rv; \ -return APR_SUCCESS; \ -} \ -return errno; \ - } \ - /* must shift descriptor to blocking mode now
cvs commit: apache-2.0/src/lib/apr/network_io/beos sockets.c
dreid 99/11/02 06:16:10 Modified:src/lib/apr/network_io/beos sockets.c Log: Fix something that was missed when the context was added to the ap_accept call. Thanks to Manoj for pointing this out. Revision ChangesPath 1.13 +0 -1 apache-2.0/src/lib/apr/network_io/beos/sockets.c Index: sockets.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/sockets.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- sockets.c 1999/11/02 11:30:37 1.12 +++ sockets.c 1999/11/02 14:16:10 1.13 @@ -147,7 +147,6 @@ sizeof(ap_socket_t)); (*new)-cntxt = connection_context; -(*new)-cntxt = sock-cntxt; (*new)-local_addr = (struct sockaddr_in *)ap_palloc((*new)-cntxt, sizeof(struct sockaddr_in)); (*new)-remote_addr = (struct sockaddr_in *)ap_palloc((*new)-cntxt,
cvs commit: apache-2.0/src/lib/apr/file_io/win32 fileacc.c
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 Revision ChangesPath 1.9 +3 -0 apache-2.0/src/lib/apr/file_io/win32/fileacc.c Index: fileacc.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/fileacc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- fileacc.c 1999/10/15 14:19:54 1.8 +++ fileacc.c 1999/11/02 14:24:56 1.9 @@ -106,6 +106,9 @@ ap_status_t ap_get_filesize(ap_ssize_t *size, struct file_t *file) { if (file != NULL) { +if (!file-stated) { +ap_getfileinfo(file); +} *size = file-size; return APR_SUCCESS; }
cvs commit: apache-2.0/src/include ap_iol.h
stoddard99/11/02 06:30:27 Modified:src/main http_protocol.c src/modules/mpm/winnt winnt.c src/os/win32 os.h iol_socket.c src/include ap_iol.h Log: First cut at adding a sendfile API to IOL. Eventually need to move iol_socket into APR... Revision ChangesPath 1.33 +17 -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.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- http_protocol.c 1999/11/01 10:50:47 1.32 +++ http_protocol.c 1999/11/02 14:30:19 1.33 @@ -2008,7 +2008,23 @@ */ API_EXPORT(long) ap_send_fd(ap_file_t *fd, request_rec *r) { -return ap_send_fd_length(fd, r, -1); +ap_ssize_t len = r-finfo.st_size; +#ifdef HAVE_SENDFILE +ap_bflush(r-connection-client); +if (ap_get_filesize(len, fd) != APR_SUCCESS) { +ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, + ap_send_fd: ap_get_filesize failed.); +return 0; +} +if (iol_sendfile(r-connection-client-iol, fd, len, + NULL, 0, 0) != APR_SUCCESS) { +ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, + ap_send_fd: iol_sendfile failed.); +} +#else +len = ap_send_fd_length(fd, r, -1); +#endif +return len; } API_EXPORT(long) ap_send_fd_length(ap_file_t *fd, request_rec *r, long length) 1.25 +1 -1 apache-2.0/src/modules/mpm/winnt/winnt.c Index: winnt.c === RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/winnt.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- winnt.c 1999/10/20 19:51:20 1.24 +++ winnt.c 1999/11/02 14:30:21 1.25 @@ -299,7 +299,7 @@ return (s_iInitCount); /* s_iInitCount == 0. Do the initailization */ -iVersionRequested = MAKEWORD(1, 1); +iVersionRequested = MAKEWORD(2, 0); err = WSAStartup((WORD) iVersionRequested, wsaData); if (err) { s_iInitCount = -1; 1.8 +1 -0 apache-2.0/src/os/win32/os.h Index: os.h === RCS file: /home/cvs/apache-2.0/src/os/win32/os.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- os.h 1999/10/05 06:01:32 1.7 +++ os.h 1999/11/02 14:30:23 1.8 @@ -108,6 +108,7 @@ #define MULTITHREAD #define HAVE_CANONICAL_FILENAME #define HAVE_DRIVE_LETTERS +#define HAVE_SENDFILE typedef int uid_t; typedef int gid_t; typedef int pid_t; 1.7 +41 -1 apache-2.0/src/os/win32/iol_socket.c Index: iol_socket.c === RCS file: /home/cvs/apache-2.0/src/os/win32/iol_socket.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- iol_socket.c 1999/10/20 20:56:03 1.6 +++ iol_socket.c 1999/11/02 14:30:24 1.7 @@ -257,13 +257,53 @@ return APR_SUCCESS; } +static ap_status_t win32_sendfile(ap_iol *viol, ap_file_t *file, long filelen, + const char *header, long hdrlen, int flags) +{ +int rv; +int lasterror; +int timeout; +HANDLE nfd; +DWORD dwFlags = 0; +iol_socket *iol = (iol_socket *)viol; + +ap_get_os_file(nfd, file); + +timeout = iol-timeout * 1000; /* setsockopt requires timeout in milliseconds */ + +rv = setsockopt(iol-fd, SOL_SOCKET, SO_SNDTIMEO, + (char*) timeout, sizeof(timeout)); +#if 0 +if (flags | APR_SENDFILE_KEEP_SOCKET) +dwFlags |= TF_REUSE_SOCKET; +if (flags | APR_SENDFILE_CLOSE_SOCKET) +dwFlags |= TF_DISCONNECT; +#else +dwFlags = 0; // TF_DISCONNECT;TF_WRITE_BEHIND;TF_REUSE_SOCKET; +#endif +rv = TransmitFile(iol-fd, /* socket */ + nfd, /* open file descriptor of the file to be sent */ + filelen, /* number of bytes to send. 0== send all */ + 0, /* Number of bytes per send. 0= use default */ + NULL, /* OVERLAPPED structure */ + NULL, /* header and trailer buffers */ + dwFlags); /* flags to control various aspects of TransmitFIle */ +if (!rv) { +lasterror = WSAGetLastError(); +printf(TransmitFile failed with error %d\n, lasterror); +return lasterror; +} +return APR_SUCCESS; +} + static const ap_iol_methods socket_methods = { win32_close, win32_write, win32_writev,
cvs commit: apache-2.0/src/main http_protocol.c
stoddard99/11/02 06:34:36 Modified:src/main http_protocol.c Log: Delete useless code... Revision ChangesPath 1.34 +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.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- http_protocol.c 1999/11/02 14:30:19 1.33 +++ http_protocol.c 1999/11/02 14:34:32 1.34 @@ -2008,7 +2008,7 @@ */ API_EXPORT(long) ap_send_fd(ap_file_t *fd, request_rec *r) { -ap_ssize_t len = r-finfo.st_size; +long len; #ifdef HAVE_SENDFILE ap_bflush(r-connection-client); if (ap_get_filesize(len, fd) != APR_SUCCESS) {
cvs commit: apache-2.0/src/modules/standard mod_auth.c mod_imap.c mod_mime.c
bjh 99/11/02 07:15:11 Modified:src/include httpd.h src/main http_config.c util.c src/modules/standard mod_auth.c mod_imap.c mod_mime.c Log: De-errno ap_pcfg_openfile(). Revision ChangesPath 1.12 +1 -1 apache-2.0/src/include/httpd.h Index: httpd.h === RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- httpd.h 1999/10/07 18:13:11 1.11 +++ httpd.h 1999/11/02 15:15:04 1.12 @@ -1004,7 +1004,7 @@ } configfile_t; /* Open a configfile_t as FILE, return open configfile_t struct pointer */ -API_EXPORT(configfile_t *) ap_pcfg_openfile(ap_context_t *p, const char *name); +API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **, ap_context_t *p, const char *name); /* Allocate a configfile_t handle with user defined functions and params */ API_EXPORT(configfile_t *) ap_pcfg_open_custom(ap_context_t *p, const char *descr, 1.16 +6 -4 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.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- http_config.c 1999/10/20 12:49:54 1.15 +++ http_config.c 1999/11/02 15:15:06 1.16 @@ -1040,8 +1040,8 @@ parms.server = s; parms.override = (RSRC_CONF | OR_ALL) ~(OR_AUTHCFG | OR_LIMIT); -if (!(parms.config_file = ap_pcfg_openfile(p,fname))) { - perror(fopen); +if (ap_pcfg_openfile(parms.config_file, p, fname) != APR_SUCCESS) { +/* ZZZ use ap_strerror() once it exists to print an error message */ fprintf(stderr, %s: could not open document config file %s\n, ap_server_argv0, fname); exit(1); @@ -1070,6 +1070,7 @@ const struct htaccess_result *cache; struct htaccess_result *new; void *dc = NULL; +ap_status_t status; /* firstly, search cache */ for (cache = r-htaccess; cache != NULL; cache = cache-next) @@ -1091,8 +1092,9 @@ while (access_name[0]) { filename = ap_make_full_path(r-pool, d, ap_getword_conf(r-pool, access_name)); +status = ap_pcfg_openfile(f, r-pool, filename); -if ((f = ap_pcfg_openfile(r-pool, filename)) != NULL) { +if (status == APR_SUCCESS) { dc = ap_create_per_dir_config(r-pool); @@ -1110,7 +1112,7 @@ *result = dc; break; } -else if (errno != ENOENT errno != ENOTDIR) { +else if (status != APR_ENOENT status != APR_ENOTDIR) { ap_log_rerror(APLOG_MARK, APLOG_CRIT, errno, r, %s pcfg_openfile: unable to check htaccess file, ensure it is readable, 1.16 +13 -15apache-2.0/src/main/util.c Index: util.c === RCS file: /home/cvs/apache-2.0/src/main/util.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- util.c1999/10/20 12:49:56 1.15 +++ util.c1999/11/02 15:15:07 1.16 @@ -855,41 +855,40 @@ } /* Open a configfile_t as FILE, return open configfile_t struct pointer */ -API_EXPORT(configfile_t *) ap_pcfg_openfile(ap_context_t *p, const char *name) +API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **ret_cfg, ap_context_t *p, const char *name) { configfile_t *new_cfg; ap_file_t *file; -int saved_errno; ap_status_t stat; ap_filetype_e type; if (name == NULL) { ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL, Internal error: pcfg_openfile() called with NULL filename); -return NULL; +return APR_EBADF; } if (!ap_os_is_filename_valid(name)) { ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL, Access to config file %s denied: not a valid filename, name); - errno = EACCES; -return NULL; +return APR_EACCES; } - + stat = ap_open(file, name, APR_READ | APR_BUFFERED, APR_OS_DEFAULT, p); #ifdef DEBUG -saved_errno = errno; ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL, Opening config file %s (%s), name, (stat != APR_SUCCESS) ? strerror(errno) : successful); -errno = saved_errno; #endif +if (stat != APR_SUCCESS) +return stat; + +stat = ap_get_filetype(type, file); if (stat != APR_SUCCESS) -return NULL; +return stat; -if
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/mpm/mpmt_beos mpmt_beos.c mpmt_beos.h scoreboard.c scoreboard.h
dreid 99/11/02 09:29:32 Modified:src/modules/mpm/mpmt_beos mpmt_beos.c mpmt_beos.h scoreboard.c scoreboard.h Log: Add support for connection_info to BeOS. This follows the stuff Manoj has added to dexter. Also take the opportunity to clean-up some of the code. Revision ChangesPath 1.8 +75 -144 apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c Index: mpmt_beos.c === RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- mpmt_beos.c 1999/11/02 12:26:41 1.7 +++ mpmt_beos.c 1999/11/02 17:29:18 1.8 @@ -104,6 +104,15 @@ ap_context_t *tpool; /* pthread would be confusing */ } proc_info; +#define SERVER_DEAD 0 +#define SERVER_DYING 1 +#define SERVER_ALIVE 2 + +static struct { +pid_t pid; +unsigned char status; +} child_table[HARD_SERVER_LIMIT]; + #if 0 #define SAFE_ACCEPT(stmt) do {if (ap_listeners-next != NULL) {stmt;}} while (0) #else @@ -115,7 +124,7 @@ * to deal with MaxClients changes across SIGWINCH restarts. We use this * value to optimize routines that have to scan the entire scoreboard. */ -static int max_daemons_limit = -1; +int max_daemons_limit = -1; static char ap_coredump_dir[MAX_STRING_LEN]; port_id port_of_death; @@ -307,8 +316,6 @@ other_child_rec *ocr, *nocr; #endif -ap_sync_scoreboard_image(); - for (tries = terminate ? 4 : 1; tries = 9; ++tries) { /* don't want to hold up progress any more than * necessary, but we need to allow children a few moments to exit. @@ -322,15 +329,16 @@ /* now see who is done */ not_dead_yet = 0; for (i = 0; i max_daemons_limit; ++i) { - int pid = ap_scoreboard_image-parent[i].pid; +int pid; +if (child_table[i].status == SERVER_DEAD) +continue; - if (pid == my_pid || pid == 0) - continue; + pid = child_table[i].pid; waitret = waitpid(pid, status, WNOHANG); if (waitret == pid || waitret == -1) { - ap_scoreboard_image-parent[i].pid = 0; - continue; + child_table[i].status = SERVER_DEAD; + continue; } ++not_dead_yet; switch (tries) { @@ -460,7 +468,6 @@ static int volatile shutdown_pending; static int volatile restart_pending; static int volatile is_graceful; -ap_generation_t volatile ap_my_generation; /* * ap_start_shutdown() and ap_start_restart(), below, are a first stab at @@ -659,8 +666,6 @@ return; } -(void) ap_update_child_status(my_child_num, my_thread_num, - SERVER_BUSY_READ, (request_rec *) NULL); conn_io = ap_bcreate(p, B_RDWR); ap_bpush_iol(conn_io, iol); @@ -703,8 +708,6 @@ workers_may_exit |= (ap_max_requests_per_child != 0) (requests_this_child = 0); if (workers_may_exit) break; -(void) ap_update_child_status(process_slot, thread_slot, SERVER_READY, - (request_rec *) NULL); SAFE_ACCEPT(intra_mutex_on(0)); if (workers_may_exit) { SAFE_ACCEPT(intra_mutex_off(0)); @@ -766,8 +769,6 @@ } ap_destroy_pool(tpool); -ap_update_child_status(process_slot, thread_slot, SERVER_DEAD, -(request_rec *) NULL); be_mutex_lock(worker_thread_count_mutex); worker_thread_count--; if (worker_thread_count == 0) { @@ -798,8 +799,6 @@ ap_create_context(pchild, pconf); /*stuff to do before we switch id's, so we have permissions.*/ -reopen_scoreboard(pchild); - SAFE_ACCEPT(intra_mutex_init(pchild, 1)); SAFE_ACCEPT(accept_mutex_child_init(pchild)); @@ -844,8 +843,6 @@ ap_create_context(my_info-tpool, pchild); /* We are creating threads right now */ - (void) ap_update_child_status(my_child_num, i, SERVER_STARTING, - (request_rec *) NULL); if ((thread = spawn_thread(worker_thread, httpd_worker_thread, B_NORMAL_PRIORITY, my_info)) B_NO_ERROR) { @@ -885,7 +882,8 @@ if (one_process) { set_signals(); -ap_scoreboard_image-parent[slot].pid = getpid(); +child_table[slot].pid = getpid(); +child_table[slot].status = SERVER_ALIVE; //child_main(slot); } @@ -903,14 +901,8 @@ } resume_thread(tid); -/*if (!pid) { -RAISE_SIGSTOP(MAKE_CHILD); -signal(SIGTERM, just_die); -child_main(slot); - return 0; -}*/ -/* else */ -
cvs commit: apache-2.0/src/lib/apr/network_io/win32 sockets.c
manoj 99/11/02 13:21:55 Modified:src/lib/apr/network_io/beos sockets.c src/lib/apr/network_io/os2 sockets.c src/lib/apr/network_io/unix sockets.c src/lib/apr/network_io/win32 sockets.c Log: Fix an APR socket bug. ap_bind would always bind to INADDR_ANY, no matter what. Revision ChangesPath 1.14 +0 -1 apache-2.0/src/lib/apr/network_io/beos/sockets.c Index: sockets.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/sockets.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -u -r1.13 -r1.14 --- sockets.c 1999/11/02 14:16:10 1.13 +++ sockets.c 1999/11/02 21:21:51 1.14 @@ -126,7 +126,6 @@ ap_status_t ap_bind(struct socket_t *sock) { -sock-local_addr-sin_addr.s_addr = INADDR_ANY; if (bind(sock-socketdes, (struct sockaddr *)sock-local_addr, sock-addr_len) == -1) return errno; else 1.9 +0 -1 apache-2.0/src/lib/apr/network_io/os2/sockets.c Index: sockets.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/os2/sockets.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -u -r1.8 -r1.9 --- sockets.c 1999/11/01 00:49:39 1.8 +++ sockets.c 1999/11/02 21:21:52 1.9 @@ -133,7 +133,6 @@ ap_status_t ap_bind(struct socket_t *sock) { -sock-local_addr-sin_addr.s_addr = INADDR_ANY; if (bind(sock-socketdes, (struct sockaddr *)sock-local_addr, sock-addr_len) == -1) return os2errno(sock_errno()); else 1.22 +0 -1 apache-2.0/src/lib/apr/network_io/unix/sockets.c Index: sockets.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockets.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -u -r1.21 -r1.22 --- sockets.c 1999/11/01 00:49:41 1.21 +++ sockets.c 1999/11/02 21:21:53 1.22 @@ -163,7 +163,6 @@ */ ap_status_t ap_bind(struct socket_t *sock) { -sock-local_addr-sin_addr.s_addr = INADDR_ANY; if (bind(sock-socketdes, (struct sockaddr *)sock-local_addr, sock-addr_len) == -1) return errno; else 1.14 +0 -1 apache-2.0/src/lib/apr/network_io/win32/sockets.c Index: sockets.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockets.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -u -r1.13 -r1.14 --- sockets.c 1999/11/01 00:49:44 1.13 +++ sockets.c 1999/11/02 21:21:54 1.14 @@ -142,7 +142,6 @@ ap_status_t ap_bind(struct socket_t *sock) { -sock-local_addr-sin_addr.s_addr = INADDR_ANY; if (bind(sock-sock, (struct sockaddr *)sock-local_addr, sock-addr_len) == -1) { return errno; }