cvs commit: apache-2.0/mpm/src/main iol_unix.c Makefile.tmpl buff.c http_connection.c http_protocol.c http_request.c
dgaudet 99/06/18 16:35:01 Modified:mpm/src CHANGES mpm/src/include buff.h mpm/src/main Makefile.tmpl buff.c http_connection.c http_protocol.c http_request.c Added: mpm/src/docs buff.txt mpm/src/include ap_iol.h mpm/src/main iol_unix.c Log: I'm sure this is wrong... but it's my start. i/o layering. Lots of stuff disabled/still to be implemented. This served up a few static requests. Revision ChangesPath 1.3 +7 -0 apache-2.0/mpm/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-2.0/mpm/src/CHANGES,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CHANGES 1999/06/18 18:58:45 1.2 +++ CHANGES 1999/06/18 23:34:56 1.3 @@ -0,0 +1,7 @@ +Changes with MPM + +* I/O layering and BUFF revamp. See docs/buff.txt. [Dean Gaudet] + +* Basic restructuring to introduce the MPM concept; includes various + changes to the module API... better described by + docs/initial_blurb.txt. [Dean Gaudet] 1.1 apache-2.0/mpm/src/docs/buff.txt Index: buff.txt === - ap_bungetc added - ap_blookc changed to return the character, rather than take a char *buff - in theory, errno is always useful on return from a BUFF routine - ap_bhalfduplex, B_SAFEREAD will be re-implemented using a layer I think - chunking gone for now, will return as a layer - ebcdic gone for now... it should be a layer 1.3 +15 -15apache-2.0/mpm/src/include/buff.h Index: buff.h === RCS file: /home/cvs/apache-2.0/mpm/src/include/buff.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- buff.h1999/06/18 19:20:47 1.2 +++ buff.h1999/06/18 23:34:58 1.3 @@ -63,6 +63,7 @@ #endif #include stdarg.h +#include ap_iol.h /* Reading is buffered */ #define B_RD (1) @@ -83,16 +84,22 @@ #define B_ERROR (48) /* TODO: implement chunked encoding as a layer */ /* bflush() if a read would block */ -#define B_SAFEREAD (128) +/* TODO: #define B_SAFEREAD (128) */ /* buffer is a socket */ #define B_SOCKET (256) +/* caller expects non-blocking behaviour */ +#define B_NONBLOCK (512) +/* non-blocking bit set on fd */ +#define B_NONBLOCK_SET (1024) + /* TODO: implement a ebcdic/ascii conversion layers */ typedef struct buff_struct BUFF; struct buff_struct { int flags; /* flags */ +int saved_errno; /* saved errno */ unsigned char *inptr;/* pointer to next location to read */ int incnt; /* number of bytes left to read from input buffer; * always 0 if had a read error */ @@ -106,14 +113,13 @@ ap_pool *pool; -/* could also put pointers to the basic I/O routines here */ -int fd; /* the file descriptor */ -time_t timeout; /* timeout for B_SOCKET operations */ +ap_iol iol; }; /* Options to bset/getopt */ #define BO_BYTECT (1) #define BO_TIMEOUT (2) +#define BO_ERROR (3) /* Stream creation and modification */ API_EXPORT(BUFF *) ap_bcreate(pool *p, int flags); @@ -136,8 +142,7 @@ /* I/O */ API_EXPORT(int) ap_bread(BUFF *fb, void *buf, int nbyte); API_EXPORT(int) ap_bgets(char *s, int n, BUFF *fb); -API_EXPORT(int) ap_blookc(char *buff, BUFF *fb); -API_EXPORT(int) ap_bskiplf(BUFF *fb); +API_EXPORT(int) ap_blookc(BUFF *fb); API_EXPORT(int) ap_bwrite(BUFF *fb, const void *buf, int nbyte); API_EXPORT(int) ap_bflush(BUFF *fb); API_EXPORT(int) ap_bputs(const char *x, BUFF *fb); @@ -153,6 +158,10 @@ #define ap_bgetc(fb) ( ((fb)-incnt == 0) ? ap_bfilbuf(fb) : \ ((fb)-incnt--, *((fb)-inptr++)) ) +/* can only unput a single character that was read by ap_bgetc */ +#define ap_bungetc(c, fb) ((fb)-incnt++, *(--(fb)-inptr) = (c)) + + #define ap_bputc(c, fb) fb)-flags (B_EOUT|B_WRERR|B_WR)) != B_WR || \ (fb)-outcnt == (fb)-bufsiz) ? ap_bflsbuf(c, (fb)) : \ ((fb)-outbase[(fb)-outcnt++] = (c), 0)) @@ -181,15 +190,6 @@ API_EXPORT(int) ap_bspawn_child(pool *, int (*)(void *, child_info *), void *, enum kill_conditions, BUFF **pipe_in, BUFF **pipe_out, BUFF **pipe_err); - -/* enable non-blocking operations */ -API_EXPORT(int) ap_bnonblock(int fd); -API_EXPORT(int) ap_bblock(int fd); -/* and get an fd to select() on */ -API_EXPORT(int) ap_bfileno(BUFF *fb, int direction); -
cvs commit: apache-2.0/mpm/src/docs buff.txt
dgaudet 99/06/18 17:17:51 Modified:mpm/src/docs buff.txt Log: rambling on Revision ChangesPath 1.2 +77 -0 apache-2.0/mpm/src/docs/buff.txt Index: buff.txt === RCS file: /home/cvs/apache-2.0/mpm/src/docs/buff.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- buff.txt 1999/06/18 23:34:57 1.1 +++ buff.txt 1999/06/19 00:17:51 1.2 @@ -1,6 +1,83 @@ +goals? we need an i/o abstraction which has these properties: + +- buffered and non-buffered modes + +The buffered mode should look like FILE *. + +The non-buffered mode should look more like read(2)/write(2). + +- blocking and non-blocking modes + +The blocking mode is the easy mode -- it's what most module writers +will see. The non-blocking mode is the hard mode, this is where +module writers wanting to squeeze out some speed will have to play. +In order to build async/sync hybrid models we need the +non-blocking i/o abstraction. + +- timed reads and writes (for blocking cases) + +This is part of my jihad against asynchronous notification. + +- i/o filtering or layering + +Yet another Holy Grail of computing. But I digress. These are +hard when you take into consideration non-blocking i/o -- you have +to keep lots of state. I expect our core filters will all support +non-blocking i/o, well at least the ones I need to make sure we kick +ass on benchmarks. A filter can deny a switch to non-blocking mode, +the server will have to recover gracefully (ha). + +- copy-avoidance + +Hey what about zero copy a la IO-Lite? After having experienced it +in a production setting I'm no longer convinced of its benefits. +There is an enormous amount of overhead keeping lists of buffers, +and reference counts, and cleanup functions, and such which requires +a lot of tuning to get right. I think there may be something here, +but it's not a cakewalk. + +What I do know is that the heuristics I put into apache-1.3 to choose +writev() at times are almost as good as what you can get from doing +full zero-copy in the cases we *currently* care about. To put it +another way, let's wait another generation to deal with zero copy. + +But sendfile/transmitfile/etc. those are still interesting. + +So instead of listing zero copy as a property, I'll list +copy-avoidance. + +So far? + - ap_bungetc added - ap_blookc changed to return the character, rather than take a char *buff - in theory, errno is always useful on return from a BUFF routine - ap_bhalfduplex, B_SAFEREAD will be re-implemented using a layer I think - chunking gone for now, will return as a layer - ebcdic gone for now... it should be a layer + +- ap_iol.h defined, first crack at the layers... + +Step back a second to think on it. Much like we have fread(3) +and read(2), I've got a BUFF and an ap_iol abstraction. An ap_iol +could use a BUFF if it requires some form of buffering, but many +won't require buffering... or can do a better job themselves. + +Consider filters such as: + - ebcdic - ascii + - encryption + - compression +These all share the property that no matter what, they're going to make +an extra copy of the data. In some cases they can do it in place (read) +or into a fixed buffer... in most cases their buffering requirements +are different than what BUFF offers. + +Consider a filter such as chunking. This could actually use the writev +method to get its job done... depends on the chunks being used. This +is where zero-copy would be really nice, but we can get by with a few +heuristics. + +At any rate -- the NSPR folks didn't see any reason to included a +buffered i/o abstraction on top of their layered i/o abstraction... so +I feel like I'm not the only one who's thinking this way. + +- iol_unix.c implemented... should hold us for a bit
Re: cvs commit: apache-2.0/mpm/src/main iol_unix.c Makefile.tmpl buff.c http_connection.c http_protocol.c http_request.c
[EMAIL PROTECTED] wrote: dgaudet 99/06/18 16:35:01 Modified:mpm/src CHANGES mpm/src/include buff.h mpm/src/main Makefile.tmpl buff.c http_connection.c http_protocol.c http_request.c Added: mpm/src/docs buff.txt mpm/src/include ap_iol.h mpm/src/main iol_unix.c Log: I'm sure this is wrong... but it's my start. i/o layering. Hoorah! Doupleplusone. 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/main iol_unix.c
dgaudet 99/06/19 10:59:58 Modified:mpm/src/main iol_unix.c Log: cleanup Revision ChangesPath 1.2 +0 -2 apache-2.0/mpm/src/main/iol_unix.c Index: iol_unix.c === RCS file: /home/cvs/apache-2.0/mpm/src/main/iol_unix.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- iol_unix.c1999/06/18 23:35:00 1.1 +++ iol_unix.c1999/06/19 17:59:57 1.2 @@ -57,8 +57,6 @@ #include httpd.h -#include http_main.h -#include http_log.h #include ap_iol.h #include errno.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_cgi.c mod_imap.c mod_include.c mod_log_config.c mod_negotiation.c mod_setenvif.c mod_userdir.c
dgaudet 99/06/19 11:10:12 Modified:mpm/src CHANGES Configuration.mpm mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_cgi.c mod_imap.c mod_include.c mod_log_config.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Port a bunch of modules to the new module structure. (All the ones currently activated in Configuration.mpm plus cgi and include... but I didn't activate those because dynamic content is broken until I fix chunking.) Submitted by: Michael H. Voase [EMAIL PROTECTED] Revision ChangesPath 1.4 +3 -0 apache-2.0/mpm/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-2.0/mpm/src/CHANGES,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CHANGES 1999/06/18 23:34:56 1.3 +++ CHANGES 1999/06/19 18:10:03 1.4 @@ -1,5 +1,8 @@ Changes with MPM +* Port a bunch of modules to the new module structure. + [Michael H. Voase [EMAIL PROTECTED]] + * I/O layering and BUFF revamp. See docs/buff.txt. [Dean Gaudet] * Basic restructuring to introduce the MPM concept; includes various 1.3 +10 -10apache-2.0/mpm/src/Configuration.mpm Index: Configuration.mpm === RCS file: /home/cvs/apache-2.0/mpm/src/Configuration.mpm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Configuration.mpm 1999/06/18 19:20:18 1.2 +++ Configuration.mpm 1999/06/19 18:10:03 1.3 @@ -23,28 +23,28 @@ Rule WANTHSREGEX=default # AddModule modules/experimental/mod_mmap_static.o # AddModule modules/standard/mod_env.o -# AddModule modules/standard/mod_log_config.o +AddModule modules/standard/mod_log_config.o # AddModule modules/standard/mod_log_agent.o # AddModule modules/standard/mod_log_referer.o # AddModule modules/standard/mod_mime_magic.o AddModule modules/standard/mod_mime.o -# AddModule modules/standard/mod_negotiation.o +AddModule modules/standard/mod_negotiation.o # AddModule modules/standard/mod_status.o # AddModule modules/standard/mod_info.o # AddModule modules/standard/mod_include.o -# AddModule modules/standard/mod_autoindex.o +AddModule modules/standard/mod_autoindex.o AddModule modules/standard/mod_dir.o # AddModule modules/standard/mod_cgi.o -# AddModule modules/standard/mod_asis.o -# AddModule modules/standard/mod_imap.o +AddModule modules/standard/mod_asis.o +AddModule modules/standard/mod_imap.o # AddModule modules/standard/mod_actions.o # AddModule modules/standard/mod_speling.o -# AddModule modules/standard/mod_userdir.o +AddModule modules/standard/mod_userdir.o # AddModule modules/proxy/libproxy.a -# AddModule modules/standard/mod_alias.o +AddModule modules/standard/mod_alias.o # AddModule modules/standard/mod_rewrite.o -# AddModule modules/standard/mod_access.o -# AddModule modules/standard/mod_auth.o +AddModule modules/standard/mod_access.o +AddModule modules/standard/mod_auth.o # AddModule modules/standard/mod_auth_anon.o # AddModule modules/standard/mod_auth_dbm.o # AddModule modules/standard/mod_auth_db.o @@ -56,4 +56,4 @@ # AddModule modules/example/mod_example.o # AddModule modules/standard/mod_unique_id.o # AddModule modules/standard/mod_so.o -# AddModule modules/standard/mod_setenvif.o +AddModule modules/standard/mod_setenvif.o 1.2 +5 -3 apache-2.0/mpm/src/modules/standard/mod_access.c Index: mod_access.c === RCS file: /home/cvs/apache-2.0/mpm/src/modules/standard/mod_access.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mod_access.c 1999/06/18 18:39:35 1.1 +++ mod_access.c 1999/06/19 18:10:04 1.2 @@ -388,7 +388,11 @@ module MODULE_VAR_EXPORT access_module = { -STANDARD_MODULE_STUFF, +STANDARD20_MODULE_STUFF, +NULL,/* pre_command */ +NULL,/* pre_config */ +NULL,/* post_config */ +NULL,/* open_logs */ NULL,/* initializer */ create_access_dir_config,/* dir config creater */ NULL,/* dir merger --- default is to override */ @@ -404,7 +408,5 @@ NULL,/* fixups */ NULL,/* logger */ NULL,/* header parser */ -NULL,/* child_init */ -NULL,/* child_exit */ NULL /* post read-request */ }; 1.2 +6 -4
cvs commit: apache-2.0/mpm/src/main http_connection.c http_protocol.c iol_unix.c
ben 99/06/19 13:23:38 Modified:mpm/src/main http_connection.c http_protocol.c iol_unix.c Log: Compile on FreeBSD. Revision ChangesPath 1.3 +0 -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_connection.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- http_connection.c 1999/06/18 23:34:59 1.2 +++ http_connection.c 1999/06/19 20:23:37 1.3 @@ -64,8 +64,6 @@ #include http_config.h #include http_vhost.h -#include poll.h - /* TODO: re-implement the lingering close stuff */ #define NO_LINGCLOSE 1.4 +0 -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.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_protocol.c 1999/06/18 23:34:59 1.3 +++ http_protocol.c 1999/06/19 20:23:37 1.4 @@ -74,7 +74,6 @@ * support code... */ #include util_date.h /* For parseHTTPdate and BAD_DATE */ #include stdarg.h -#include poll.h #define SET_BYTES_SENT(r) \ do { if (r-sent_bodyct) \ 1.3 +3 -0 apache-2.0/mpm/src/main/iol_unix.c Index: iol_unix.c === RCS file: /export/home/cvs/apache-2.0/mpm/src/main/iol_unix.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- iol_unix.c1999/06/19 17:59:57 1.2 +++ iol_unix.c1999/06/19 20:23:37 1.3 @@ -63,6 +63,9 @@ #include sys/types.h #include sys/uio.h +#ifndef ETIME +# define ETIME -1 +#endif #define FD_NONBLOCKING_SET (1)
cvs commit: apache-2.0/mpm/src/main iol_unix.c
dgaudet 99/06/19 13:40:18 Modified:mpm/src/include ap_iol.h mpm/src/main iol_unix.c Log: use ETIMEDOUT instead of ETIME Revision ChangesPath 1.2 +1 -1 apache-2.0/mpm/src/include/ap_iol.h Index: ap_iol.h === RCS file: /home/cvs/apache-2.0/mpm/src/include/ap_iol.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ap_iol.h 1999/06/18 23:34:57 1.1 +++ ap_iol.h 1999/06/19 20:40:16 1.2 @@ -80,7 +80,7 @@ If the timeout is positive, they will block up to the specified number of seconds. If the read/write can't be completed in that time, -a -1 will be returned and errno will be set to ETIME. +a -1 will be returned and errno will be set to ETIMEDOUT. TODO: we've all agreed errno is somewhat evil, and it must be replaced by a status result code. I'll leave that to someone else. 1.4 +1 -5 apache-2.0/mpm/src/main/iol_unix.c Index: iol_unix.c === RCS file: /home/cvs/apache-2.0/mpm/src/main/iol_unix.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- iol_unix.c1999/06/19 20:23:37 1.3 +++ iol_unix.c1999/06/19 20:40:17 1.4 @@ -63,10 +63,6 @@ #include sys/types.h #include sys/uio.h -#ifndef ETIME -# define ETIME -1 -#endif - #define FD_NONBLOCKING_SET (1) typedef struct { @@ -146,7 +142,7 @@ rv = select(fd-fd + 1, selread, selwrite, NULL, fd-timeout 0 ? NULL : tv); \ } while (rv == -1 errno == EINTR); \ if (!FD_ISSET(fd-fd, fdset)) { \ - errno = ETIME; \ + errno = ETIMEDOUT; \ return -1; \ } \ do { \
cvs commit: apache-2.0/mpm/src/modules/standard mod_env.c
ben 99/06/19 13:40:50 Modified:mpm/src Configuration.mpm mpm/src/modules/standard mod_env.c Log: Port mod_env (I think). Revision ChangesPath 1.4 +1 -1 apache-2.0/mpm/src/Configuration.mpm Index: Configuration.mpm === RCS file: /export/home/cvs/apache-2.0/mpm/src/Configuration.mpm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Configuration.mpm 1999/06/19 18:10:03 1.3 +++ Configuration.mpm 1999/06/19 20:40:48 1.4 @@ -22,7 +22,7 @@ Rule EXPAT=no Rule WANTHSREGEX=default # AddModule modules/experimental/mod_mmap_static.o -# AddModule modules/standard/mod_env.o +AddModule modules/standard/mod_env.o AddModule modules/standard/mod_log_config.o # AddModule modules/standard/mod_log_agent.o # AddModule modules/standard/mod_log_referer.o 1.2 +6 -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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mod_env.c 1999/06/18 18:39:38 1.1 +++ mod_env.c 1999/06/19 20:40:49 1.2 @@ -248,8 +248,12 @@ module MODULE_VAR_EXPORT env_module = { -STANDARD_MODULE_STUFF, -NULL, /* initializer */ +STANDARD20_MODULE_STUFF, +NULL,/* pre_command_line */ +NULL,/* pre_config */ +NULL,/* post_config */ +NULL,/* open_logs */ +NULL,/* child initializer */ create_env_dir_config, /* dir config creater */ merge_env_dir_configs, /* dir merger --- default is to override */ NULL, /* server config */
cvs commit: apache-2.0/mpm/src/include ap_buf.h
dgaudet 99/06/19 13:42:01 Modified:mpm/src/ap Makefile.tmpl Added: mpm/src/ap ap_buf.c mpm/src/include ap_buf.h Log: this is where I'm going with the zero-copy stuff Revision ChangesPath 1.3 +1 -1 apache-2.0/mpm/src/ap/Makefile.tmpl Index: Makefile.tmpl === RCS file: /home/cvs/apache-2.0/mpm/src/ap/Makefile.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Makefile.tmpl 1999/06/18 19:07:57 1.2 +++ Makefile.tmpl 1999/06/19 20:41:59 1.3 @@ -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_slack.o ap_snprintf.o ap_buf.o .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $ 1.1 apache-2.0/mpm/src/ap/ap_buf.c Index: ap_buf.c === /* * Copyright (c) 1996-1999 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *This product includes software developed by the Apache Group *for use in the Apache HTTP server project (http://www.apache.org/). * * 4. The names Apache Server and Apache Group must not be used to *endorse or promote products derived from this software without *prior written permission. For written permission, please contact *[EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *This product includes software developed by the Apache Group *for use in the Apache HTTP server project (http://www.apache.org/). * * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Group and was originally based * on public domain software written at the National Center for * Supercomputing Applications, University of Illinois, Urbana-Champaign. * For more information on the Apache Group and the Apache HTTP server * project, please see http://www.apache.org/. * */ #include ap_config.h #include stdlib.h #include sys/uio.h #include ap_buf.h API_EXPORT(ap_bufel *) ap_bufel_new(void) { /* TODO: keep a free list of ap_bufels... and allocate them in big chunks */ return malloc(sizeof(ap_bufel)); } API_EXPORT(void) ap_bufel_destroy(ap_bufel *e) { e-free(e); free(e); } API_EXPORT(void) ap_buf_init(ap_buf *b) { b-head = NULL; b-tail = b-head; } API_EXPORT(void) ap_buf_append(ap_buf *b, ap_bufel *e) { e-next = *b-tail; b-tail = e-next; } API_EXPORT(void) ap_buf_consume(ap_buf *b, int nbytes) { ap_bufel *e; ap_bufel *n; int amt; e = b-head; while (e nbytes) { amt = e-end - e-start; if (nbytes amt) { e-start += nbytes; break; } n = e-next; ap_bufel_destroy(e); nbytes -= amt; e = n; } b-head = e; if (!e) { b-tail = b-head; } }
cvs commit: apache-2.0/mpm/src/main mpm_prefork.c
dgaudet 99/06/19 14:56:28 Modified:mpm/src/main mpm_prefork.c Log: Ben L. was complaining that he wanted -X ... try -D ONE_PROCESS now instead. The general problem is that mpms need arbitrary extensions to the command line options... -D seems somewhat reasonable. Although I can think of better stuff. This works for now. Revision ChangesPath 1.2 +3 -1 apache-2.0/mpm/src/main/mpm_prefork.c Index: mpm_prefork.c === RCS file: /home/cvs/apache-2.0/mpm/src/main/mpm_prefork.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mpm_prefork.c 1999/06/18 18:39:31 1.1 +++ mpm_prefork.c 1999/06/19 21:56:27 1.2 @@ -3680,12 +3680,14 @@ { static int restart_num = 0; +one_process = ap_exists_config_define(ONE_PROCESS); + /* sigh, want this only the second time around */ if (restart_num++ == 1) { is_graceful = 0; if (!one_process) { - //detach(); + /* TODO: detach(); ... it should work fine, this is just easier for debugging */ } my_pid = getpid();
cvs commit: apache-2.0/mpm/src/modules/standard mod_env.c
jim 99/06/19 15:04:39 Modified:mpm/src/modules/standard mod_env.c Log: Too many elements Revision ChangesPath 1.3 +0 -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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_env.c 1999/06/19 20:40:49 1.2 +++ mod_env.c 1999/06/19 22:04:39 1.3 @@ -268,7 +268,5 @@ fixup_env_module, /* fixups */ NULL, /* logger */ NULL, /* header parser */ -NULL, /* child_init */ -NULL, /* child_exit */ NULL/* post read-request */ };
cvs commit: apache-2.0/mpm/src Configuration.mpm
jim 99/06/19 15:16:04 Modified:mpm/src Configuration.mpm Log: FreeBSD requires this to grab the thread lib for pthreads. Uncomment when trying on that Revision ChangesPath 1.5 +1 -1 apache-2.0/mpm/src/Configuration.mpm Index: Configuration.mpm === RCS file: /export/home/cvs/apache-2.0/mpm/src/Configuration.mpm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Configuration.mpm 1999/06/19 20:40:48 1.4 +++ Configuration.mpm 1999/06/19 22:16:03 1.5 @@ -1,5 +1,5 @@ EXTRA_CFLAGS= -Wall -EXTRA_LDFLAGS= +EXTRA_LDFLAGS= #-pthread # Uncomment for FreeBSD EXTRA_LIBS= EXTRA_INCLUDES= EXTRA_DEPS=