cvs commit: apachen/src/main http_main.c

1997-10-15 Thread dgaudet
dgaudet 97/10/14 17:14:33

  Modified:src/main http_main.c
  Log:
  clear_pool() was called before copy_listeners, and copy_listeners was using
  pointers from the cleared pool.
  
  close(scoreboard_fd) was happening before the scoreboard was even opened.
  
  Reviewed by:  Jim Jagielski, Rob Hartill
  
  Revision  ChangesPath
  1.235 +2 -3  apachen/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
  retrieving revision 1.234
  retrieving revision 1.235
  diff -u -r1.234 -r1.235
  --- http_main.c   1997/10/07 19:34:01 1.234
  +++ http_main.c   1997/10/15 00:14:31 1.235
  @@ -1406,7 +1406,7 @@
   #else
   #define SCOREBOARD_FILE
   static scoreboard _scoreboard_image;
  -static int scoreboard_fd;
  +static int scoreboard_fd = -1;
   
   /* XXX: things are seriously screwed if we ever have to do a partial
* read or write ... we could get a corrupted scoreboard
  @@ -3122,7 +3122,7 @@
restart_time = time(NULL);
}
   #ifdef SCOREBOARD_FILE
  - else {
  + else if (scoreboard_fd != -1) {
kill_cleanups_for_fd(pconf, scoreboard_fd);
}
   #endif
  @@ -3392,7 +3392,6 @@
   init_modules(pconf, server_conf);
   
   if (standalone) {
  - clear_pool(pconf);  /* standalone_main rereads... */
STANDALONE_MAIN(argc, argv);
   }
   else {
  
  
  


cvs commit: apachen/src/main http_request.c

1997-10-15 Thread dgaudet
dgaudet 97/10/14 17:15:14

  Modified:src/main http_request.c
  Log:
  Fix an off-by-one error introduced in one of the directory_walk optimizations.
  
  Reviewed by:  Jim Jagielski, Rob Hartill
  
  Revision  ChangesPath
  1.89  +3 -1  apachen/src/main/http_request.c
  
  Index: http_request.c
  ===
  RCS file: /export/home/cvs/apachen/src/main/http_request.c,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- http_request.c1997/10/07 05:27:08 1.88
  +++ http_request.c1997/10/15 00:15:13 1.89
  @@ -364,8 +364,10 @@
* We will use test_dirname as scratch space while we build directory
* names during the walk.  Profiling shows directory_walk to be a busy
* function so we try to avoid allocating lots of extra memory here.
  + * We need 2 extra bytes, one for trailing \0 and one because
  + * make_dirstr_prefix will add potentially one extra /.
*/
  -test_dirname = palloc(r-pool, test_filename_len + 1);
  +test_dirname = palloc(r-pool, test_filename_len + 2);
   
   /* j keeps track of which section we're on, see core_reorder_directories 
*/
   j = 0;
  
  
  


cvs commit: apachen/src/main alloc.c

1997-10-15 Thread dgaudet
dgaudet 97/10/14 17:19:36

  Modified:src/main alloc.c
  Log:
  Add in alloc debugging code which can be used standalone to detect some
  uninitialized read, and use-after-free errors.  It can also be combined with
  debuggers like efence and Purify.  By default nothing should change.
  
  This change introduces one change to the non-debugging code:
  
  -blok = new_block(0);
  +blok = new_block(POOL_HDR_BYTES);
  
  This is during make_sub_pool.  Technically speaking, this fixes a bug;
  the bug was that make_sub_pool was assuming that
  BLOCK_MINALLOC  POOL_HDR_BYTES.  Not an unreasonable assumption ... but
  the debugging code sets BLOCK_MINALLOC to 0.
  
  Reviewed by:  Jim Jagielski, Rob Hartill, Martin Kraemer
  
  Revision  ChangesPath
  1.50  +109 -5apachen/src/main/alloc.c
  
  Index: alloc.c
  ===
  RCS file: /export/home/cvs/apachen/src/main/alloc.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- alloc.c   1997/10/05 02:06:36 1.49
  +++ alloc.c   1997/10/15 00:19:35 1.50
  @@ -63,6 +63,37 @@
   
   #include stdarg.h
   
  +/* debugging support, define this to enable code which helps detect re-use
  + * of freed memory and other such nonsense.
  + *
  + * The theory is simple.  The FILL_BYTE (0xa5) is written over all malloc'd
  + * memory as we receive it, and is written over everything that we free up
  + * during a clear_pool.  We check that blocks on the free list always
  + * have the FILL_BYTE in them, and we check during palloc() that the bytes
  + * still have FILL_BYTE in them.  If you ever see garbage URLs or whatnot
  + * containing lots of 0xa5s then you know something used data that's been
  + * freed.
  + */
  +/* #define ALLOC_DEBUG */
  +
  +/* debugging support, if defined all allocations will be done with
  + * malloc and free()d appropriately at the end.  This is intended to be
  + * used with something like Electric Fence or Purify to help detect
  + * memory problems.  Note that if you're using efence then you should also
  + * add in ALLOC_DEBUG.  But don't add in ALLOC_DEBUG if you're using Purify
  + * because ALLOC_DEBUG would hide all the uninitialized read errors that
  + * Purify can diagnose.
  + */
  +/* #define ALLOC_USE_MALLOC */
  +
  +#ifdef ALLOC_USE_MALLOC
  +#undef BLOCK_MINFREE
  +#undef BLOCK_MINALLOC
  +#define BLOCK_MINFREE0
  +#define BLOCK_MINALLOC   0
  +#endif
  +
  +
   /*
*
* Managing free storage blocks...
  @@ -98,6 +129,28 @@
   mutex *alloc_mutex = NULL;
   mutex *spawn_mutex = NULL;
   
  +#ifdef ALLOC_DEBUG
  +#define FILL_BYTE((char)(0xa5))
  +
  +#define debug_fill(ptr,size) ((void)memset((ptr), FILL_BYTE, (size)))
  +
  +static ap_inline void debug_verify_filled(const char *ptr,
  +const char *endp, const char *error_msg)
  +{
  +for (; ptr  endp; ++ptr) {
  + if (*ptr != FILL_BYTE) {
  + fputs(error_msg, stderr);
  + abort();
  + exit(1);
  + }
  +}
  +}
  +
  +#else
  +#define debug_fill(a,b)
  +#define debug_verify_filled(a,b,c)
  +#endif
  +
   
   /* Get a completely new block from the system pool. Note that we rely on
  malloc() to provide aligned memory. */
  @@ -111,6 +164,7 @@
fprintf(stderr, Ouch!  malloc failed in malloc_block()\n);
exit(1);
   }
  +debug_fill(blok, size + sizeof(union block_hdr));
   blok-h.next = NULL;
   blok-h.first_avail = (char *) (blok + 1);
   blok-h.endp = size + blok-h.first_avail;
  @@ -138,6 +192,14 @@
   
   void free_blocks(union block_hdr *blok)
   {
  +#ifdef ALLOC_USE_MALLOC
  +union block_hdr *next;
  +
  +for (; blok; blok = next) {
  + next = blok-h.next;
  + free(blok);
  +}
  +#else
   /* First, put new blocks at the head of the free list ---
* we'll eventually bash the 'next' pointer of the last block
* in the chain to point to the free blocks we already had.
  @@ -161,21 +223,22 @@
   while (blok-h.next != NULL) {
chk_on_blk_list(blok, old_free_list);
blok-h.first_avail = (char *) (blok + 1);
  + debug_fill(blok-h.first_avail, blok-h.endp - blok-h.first_avail);
blok = blok-h.next;
   }
   
   chk_on_blk_list(blok, old_free_list);
   blok-h.first_avail = (char *) (blok + 1);
  +debug_fill(blok-h.first_avail, blok-h.endp - blok-h.first_avail);
   
   /* Finally, reset next pointer to get the old free blocks back */
   
   blok-h.next = old_free_list;
   (void) release_mutex(alloc_mutex);
  +#endif
   }
   
   
  -
  -
   /* Get a new block, from our own free list if possible, from the system
* if necessary.  Must be called with alarms blocked.
*/
  @@ -193,6 +256,8 @@
if (min_size + BLOCK_MINFREE = blok-h.endp - blok-h.first_avail) {
*lastptr = blok-h.next;
 

cvs commit: apachen/src CHANGES

1997-10-15 Thread dgaudet
dgaudet 97/10/14 17:24:06

  Modified:htdocs/manual new_features_1_3.html
   src  CHANGES
  Log:
  Document alloc debugging.
  
  Revision  ChangesPath
  1.27  +10 -0 apachen/htdocs/manual/new_features_1_3.html
  
  Index: new_features_1_3.html
  ===
  RCS file: /export/home/cvs/apachen/htdocs/manual/new_features_1_3.html,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- new_features_1_3.html 1997/10/07 19:44:36 1.26
  +++ new_features_1_3.html 1997/10/15 00:24:01 1.27
  @@ -395,6 +395,16 @@
   An option to codespawn_child/code functions which prevents Apache
   from aggressively trying to kill off the child.
   
  +listrongcodealloc debugging code/code/strongbr
  +Defining codeALLOC_DEBUG/code provides a rudimentary memory
  +debugger which can be used on live servers with low impact --
  +it sets all allocated and freed memory bytes to 0xa5.  Defining
  +codeALLOC_USE_MALLOC/code will cause the alloc code to use
  +codemalloc()/code and codefree()/code for each object.  This
  +is far more expensive and should only be used for testing with tools
  +such as Electric Fence and Purify.  See codemain/alloc.c/code
  +for more details.
  +
   /ul
   
   /ul
  
  
  
  1.463 +8 -0  apachen/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apachen/src/CHANGES,v
  retrieving revision 1.462
  retrieving revision 1.463
  diff -u -r1.462 -r1.463
  --- CHANGES   1997/10/07 20:04:58 1.462
  +++ CHANGES   1997/10/15 00:24:03 1.463
  @@ -1,5 +1,13 @@
   Changes with Apache 1.3b1
   
  +  *) Add debugging code to alloc.c.  Defining ALLOC_DEBUG provides a
  + rudimentary memory debugger which can be used on live servers with
  + low impact -- it sets all allocated and freed memory bytes to 0xa5.
  + Defining ALLOC_USE_MALLOC will cause the alloc code to use malloc()
  + and free() for each object.  This is far more expensive and should
  + only be used for testing with tools such as Electric Fence and
  + Purify.  See main/alloc.c for more details.  [Dean Gaudet]
  +
 *) Configure uses a sh trap and didn't set its exitcode properly.
[Dean Gaudet] PR#1159
   
  
  
  


cvs commit: apache-site/contributors index.html

1997-10-15 Thread mjc
mjc 97/10/15 05:24:02

  Modified:contributors index.html
  Log:
  Swap to a personal email and web address that will be valid forever.
  
  Revision  ChangesPath
  1.18  +4 -4  apache-site/contributors/index.html
  
  Index: index.html
  ===
  RCS file: /export/home/cvs/apache-site/contributors/index.html,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- index.html1997/10/10 20:07:16 1.17
  +++ index.html1997/10/15 12:24:02 1.18
  @@ -175,14 +175,14 @@
   P
   
   BName:/B A NAME=coxMark Cox/ABR
  -Bemail:/B A HREF=mailto:[EMAIL PROTECTED][EMAIL PROTECTED]/ABR
  -BURL:/B A 
HREF=http://www.ukweb.com/~mark/;http://www.ukweb.com/~mark//ABR
  +Bemail:/B A HREF=mailto:[EMAIL PROTECTED][EMAIL PROTECTED]/ABR
  +BURL:/B A 
HREF=http://www.awe.com/~mark/;http://www.awe.com/~mark//ABR
   BOrganization:/B UK Web LtdBR
   BOccupation:/B Technical DirectorBR
   BLocation:/B Leeds, EnglandBR
   BContributions:/B Various patches, bug fixes, and DBM code alterations 
bringing
  - Apache in line with what we were using on www.telescope.org.  Initial 
cookie
  - module for clickstream tracking with Netscape.  Server Status module.,
  + Apache in line with what we were using on www.telescope.org.  Cookie
  + module.  Server Status module.
Contributor to a href=http://www.apacheweek.com/;Apache Week/aBR
   
   P
  
  
  


cvs commit: apachen/htdocs/manual/mod directive-dict.html directives.html mod_example.html mod_proxy.html

1997-10-15 Thread coar
coar97/10/15 07:45:27

  Modified:htdocs/manual/mod directives.html mod_example.html
mod_proxy.html
  Added:   htdocs/manual/mod directive-dict.html
  Log:
Clean up some typos in the proxy documentation, and add a
dictionary for the directive attributes (status, override,
et cetera) - part of the directive-documentation-normalisation
effort, and something I've wanted for a long time.  Updated the
mod_example page to use the links to the dictionary (as an example ;-).
  
  Revision  ChangesPath
  1.34  +9 -1  apachen/htdocs/manual/mod/directives.html
  
  Index: directives.html
  ===
  RCS file: /export/home/cvs/apachen/htdocs/manual/mod/directives.html,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- directives.html   1997/09/12 09:38:03 1.33
  +++ directives.html   1997/10/15 14:45:24 1.34
  @@ -14,7 +14,15 @@
   
   !--#include virtual=header.html --
   H1 ALIGN=CENTERApache Directives/H1
  -
  +P
  +Each Apache directive available in the standard Apache distribution is
  +listed here.  They are described using a consistent format, and there is
  +A
  + HREF=directive-dict.html
  + REL=Glossary
  +a dictionary/A
  +of the terms used in their descriptions available.
  +/P
   ul
   liA HREF=core.html#accessconfigAccessConfig/A
   liA HREF=core.html#accessfilenameAccessFileName/A
  
  
  
  1.5   +33 -7 apachen/htdocs/manual/mod/mod_example.html
  
  Index: mod_example.html
  ===
  RCS file: /export/home/cvs/apachen/htdocs/manual/mod/mod_example.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_example.html  1997/09/11 13:27:50 1.4
  +++ mod_example.html  1997/10/15 14:45:25 1.5
  @@ -117,20 +117,46 @@
  Example
 /A/H2
 P
  -  STRONGSyntax:/STRONG Example
  +  A
  +   HREF=directive-dict.html#Syntax
  +   REL=Help 
  +  STRONGSyntax:/STRONG/A Example
 BR
  -  STRONGDefault:/STRONG None
  +  A
  +   HREF=directive-dict.html#Default
  +   REL=Help 
  +  STRONGDefault:/STRONG/A None
 BR
  -  STRONGContext:/STRONG server config, virtual host, directory, .htaccess
  +  A
  +   HREF=directive-dict.html#Context
  +   REL=Help 
  +  STRONGContext:/STRONG/A server config, virtual host, directory,
  +  .htaccess
 BR
  -  STRONGOverride:/STRONG Options
  +  A
  +   HREF=directive-dict.html#Override
  +   REL=Help 
  +  STRONGOverride:/STRONG/A Options
 BR
  -  STRONGStatus:/STRONG Extension
  +  A
  +   HREF=directive-dict.html#Status
  +   REL=Help 
  +  STRONGStatus:/STRONG/A Extension
 BR
  -  STRONGModule:/STRONG mod_example
  +  A
  +   HREF=directive-dict.html#Module
  +   REL=Help 
  +  STRONGModule:/STRONG/A mod_example
  +  BR
  +  A
  +   HREF=directive-dict.html#Compatibility
  +   REL=Help 
  +  STRONGCompatibility:/STRONG/A SAMPExample/SAMP is only
  +   available in Apache 1.2 and later.
 /P
 P
  -  The Example directive activates the example module's content handler
  +  The SAMPExample/SAMP directive activates the example module's
  +  content handler 
 for a particular location or file type.  It takes no arguments.  If
 you browse to an URL to which the example content-handler applies, you
 will get a display of the routines within the module and how and in
  
  
  
  1.29  +95 -33apachen/htdocs/manual/mod/mod_proxy.html
  
  Index: mod_proxy.html
  ===
  RCS file: /export/home/cvs/apachen/htdocs/manual/mod/mod_proxy.html,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- mod_proxy.html1997/07/21 04:41:57 1.28
  +++ mod_proxy.html1997/10/15 14:45:25 1.29
  @@ -17,13 +17,15 @@
   
   This module is contained in the codemod_proxy.c/code file for Apache 
1.1.x,
   or the codemodules/proxy/code subdirectory for Apache 1.2, and
  -is not compiled in by default. It provides for an bHTTP 1.0/b caching 
proxy
  +is not compiled in by default. It provides for an STRONGHTTP
  +1.0/STRONG caching proxy 
   server. It is only available in Apache 1.1 and later. Common configuration
  -questions are addressed a href=#configshere/a.
  +questions are addressed a href=#configsafter the directive
  +descriptions/a.
   
   h3Note:/h3
   pThis module was experimental in Apache 1.1.x. As of Apache 1.2, mod_proxy
  -stability is igreatly/i improved.p
  +stability is EMgreatly/EM improved.p
   
   h2Summary/h2
   
  @@ -61,18 +63,23 @@
   strongSyntax:/strong ProxyRequests emon/off/embr
   strongDefault:/strong codeProxyRequests Off/codebr
   strongContext:/strong server config, virtual hostbr
  +strongOverride:/strong EMNot applicable/EMbr
   strongStatus:/strong Basebr
   strongModule:/strong mod_proxybr
  

cvs commit: apachen/src/modules/example mod_example.c

1997-10-15 Thread coar
coar97/10/15 08:34:23

  Modified:src/modules/example mod_example.c
  Log:
Correct returns from auth/auth hooks so they don't interfere
with *real* auth/auth activities by other modules.
  
  PR:   603
  
  Revision  ChangesPath
  1.21  +2 -2  apachen/src/modules/example/mod_example.c
  
  Index: mod_example.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/example/mod_example.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- mod_example.c 1997/10/07 19:57:44 1.20
  +++ mod_example.c 1997/10/15 15:34:22 1.21
  @@ -940,7 +940,7 @@
* didn't actually do anything).
*/
   trace_add(r-server, r, cfg, example_auth_checker());
  -return OK;
  +return DECLINED;
   }
   
   /*
  @@ -959,7 +959,7 @@
   
   cfg = our_dconfig(r);
   trace_add(r-server, r, cfg, example_access_checker());
  -return OK;
  +return DECLINED;
   }
   
   /*
  
  
  


cvs commit: apachen/htdocs/manual LICENSE

1997-10-15 Thread jim
jim 97/10/15 13:22:49

  Modified:.LICENSE
   htdocs/manual LICENSE
  Log:
  Put the Email address of who to contact
  
  Revision  ChangesPath
  1.7   +2 -1  apachen/LICENSE
  
  Index: LICENSE
  ===
  RCS file: /export/home/cvs/apachen/LICENSE,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LICENSE   1997/01/01 18:32:07 1.6
  +++ LICENSE   1997/10/15 20:22:47 1.7
  @@ -20,7 +20,8 @@
*
* 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.
  + *prior written permission. For written permission, please contact
  + *[EMAIL PROTECTED]
*
* 5. Redistributions of any form whatsoever must retain the following
*acknowledgment:
  
  
  
  1.4   +2 -1  apachen/htdocs/manual/LICENSE
  
  Index: LICENSE
  ===
  RCS file: /export/home/cvs/apachen/htdocs/manual/LICENSE,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LICENSE   1997/01/01 18:32:13 1.3
  +++ LICENSE   1997/10/15 20:22:48 1.4
  @@ -20,7 +20,8 @@
*
* 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.
  + *prior written permission. For written permission, please contact
  + *[EMAIL PROTECTED]
*
* 5. Redistributions of any form whatsoever must retain the following
*acknowledgment:
  
  
  


cvs commit: apachen/src Makefile.tmpl

1997-10-15 Thread jim
jim 97/10/15 13:30:03

  Modified:src  Makefile.tmpl
  Log:
  Pass  to the link stage
  
  Revision  ChangesPath
  1.69  +1 -1  apachen/src/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===
  RCS file: /export/home/cvs/apachen/src/Makefile.tmpl,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- Makefile.tmpl 1997/10/07 19:53:21 1.68
  +++ Makefile.tmpl 1997/10/15 20:30:02 1.69
  @@ -30,7 +30,7 @@
rm -f buildmark.c
echo 'const char SERVER_BUILT[] = '`date`';'  buildmark.c
$(CC) -c $(CFLAGS) buildmark.c
  - $(CC) $(LDFLAGS)  -o httpd buildmark.o $(OBJS) $(REGLIB) $(LIBS)
  + $(CC) $(CFLAGS) $(LDFLAGS)  -o httpd buildmark.o $(OBJS) $(REGLIB) 
$(LIBS)
   
   subdirs:
for i in $(SUBDIRS); do \