cvs commit: apachen/src/modules/standard mod_negotiation.c

1997-12-19 Thread dgaudet
dgaudet 97/12/19 10:24:59

  Modified:src  CHANGES
   src/modules/standard mod_negotiation.c
  Log:
  Fix a potential SEGV -- the hdr variable was being incremented twice
  going past the \0 terminator.
  
  Reviewed by:  Jim Jagielski, Martin Kraemer
  
  Revision  ChangesPath
  1.531 +3 -0  apachen/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apachen/src/CHANGES,v
  retrieving revision 1.530
  retrieving revision 1.531
  diff -u -r1.530 -r1.531
  --- CHANGES   1997/12/19 02:17:15 1.530
  +++ CHANGES   1997/12/19 18:24:50 1.531
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3b4
   
  +  *) Fix a potential SEGV problem in mod_negotiation when dealing
  + with type-maps.  [Dean Gaudet]
  +
 *) Better glibc support under Linux.  [Dean Gaudet] PR#1542
   
 *) RedirectMatch gone / would cause a SIGSEGV. [Dean Gaudet] PR#1319
  
  
  
  1.62  +5 -4  apachen/src/modules/standard/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_negotiation.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- mod_negotiation.c 1997/10/22 20:30:26 1.61
  +++ mod_negotiation.c 1997/12/19 18:24:52 1.62
  @@ -645,10 +645,11 @@
   
   while (*hdr) {
   if (*hdr == '') {
  -while (*++hdr  *hdr != '') {
  -continue;
  -}
  -++hdr;
  + hdr = strchr(hdr, '');
  + if (hdr == NULL) {
  + return;
  + }
  + ++hdr;
   }
   else if (*hdr == '(') {
   while (*hdr  *hdr != ')') {
  
  
  


cvs commit: apachen/src/modules/standard mod_negotiation.c

1997-10-17 Thread ben
ben 97/10/17 12:26:57

  Modified:src/modules/standard mod_negotiation.c
  Log:
  Fix undefined behaviour. (Note, this patch is also included in the Win32 
1.3b2).
  
  Revision  ChangesPath
  1.59  +2 -2  apachen/src/modules/standard/mod_negotiation.c
  
  Index: mod_negotiation.c
  cvs diff: cannot exec /usr/local/bin/rcsdiff: No such file or directory
  
  
  


cvs commit: apachen/src/modules/standard mod_negotiation.c

1997-08-23 Thread Paul Sutton
pcs 97/08/23 07:20:36

  Modified:src/modules/standard mod_negotiation.c
  Log:
  mod_negotiation marks *all* responses
  (HTTP/1.0) browsers and proxies caching one variant which may not be the
  correct one for subsequent requests. The issue is that if you are using
  mod_negotiation in a trivial way to map (say) requests for index onto
  index.html *with no other variants*, Apache makes your responses
  non-cacheable when they probably are safely cacheable.
  
  This patch makes responses from mod_negotiation cacheable in the following
  circumstances:
  
*  Variants are found by multiviews (i.e. looking on the disk, rather
   than reading a .var file) AND
*  there was only one matching variant found on disk AND
*  request version is HTTP/1.0 or earlier
  
  Reviewed By: Roy Fielding, Dean Gaudet
  
  Revision  ChangesPath
  1.55  +9 -1  apachen/src/modules/standard/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_negotiation.c,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- mod_negotiation.c 1997/08/18 13:12:16 1.54
  +++ mod_negotiation.c 1997/08/23 14:20:35 1.55
  @@ -227,6 +227,8 @@
   array_header *accept_langs; /* accept_recs */
   array_header *avail_vars;   /* available variants */
   
  +int count_multiviews_variants; /* number of variants found on disk */
  +
   int ua_can_negotiate;   /* 1 if ua can do transparent negotiate */
   int use_transparent_neg;/* 1 if we are using transparent neg */
   int short_accept_headers;   /* 1 if ua does trans neg  sent short accpt 
*/
  @@ -649,6 +651,9 @@
   char buffer[MAX_STRING_LEN];
   enum header_state hstate;
   struct var_rec mime_info;
  +
  +/* We are not using multiviews */
  +neg-count_multiviews_variants = 0;
   
   if (rr-status != HTTP_OK) {
return rr-status;
  @@ -809,6 +814,8 @@

new_var = push_array (neg-avail_vars);
memcpy (new_var, (void *)mime_info, sizeof (var_rec));
  +
  + neg-count_multiviews_variants++;

clean_var_rec(mime_info);
   }
  @@ -1994,7 +2001,8 @@
   
   /* Otherwise, use it. */
   
  -if (!do_cache_negotiated_docs(r-server)  (r-proto_num  1001))
  +if ((!do_cache_negotiated_docs(r-server)  (r-proto_num  1001))
  +  neg-count_multiviews_variants != 1)
   r-no_cache = 1;
   
   if (na_result == na_not_applied)