httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0 CHANGES
Date Sat, 11 May 2002 23:24:29 GMT
brianp      02/05/11 16:24:29

  Modified:    include  http_core.h
               server   core.c
               .        CHANGES
  Log:
  Added EnableMMAP directive to allow the server administrator to
  prevent mmap of file buckets upon read.
  
  Revision  Changes    Path
  1.67      +9 -0      httpd-2.0/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- http_core.h	5 Apr 2002 20:55:38 -0000	1.66
  +++ http_core.h	11 May 2002 23:24:29 -0000	1.67
  @@ -515,6 +515,15 @@
       etag_components_t etag_bits;
       etag_components_t etag_add;
       etag_components_t etag_remove;
  +
  +    /*
  +     * Run-time performance tuning
  +     */
  +#define ENABLE_MMAP_OFF    (0)
  +#define ENABLE_MMAP_ON     (1)
  +#define ENABLE_MMAP_UNSET  (2)
  +    int enable_mmap;  /* whether files in this dir can be mmap'ed */
  +
   } core_dir_config;
   
   /* Per-server core configuration */
  
  
  
  1.176     +36 -0     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.175
  retrieving revision 1.176
  diff -u -r1.175 -r1.176
  --- core.c	10 May 2002 15:08:59 -0000	1.175
  +++ core.c	11 May 2002 23:24:29 -0000	1.176
  @@ -180,6 +180,8 @@
       conf->etag_add = ETAG_UNSET;
       conf->etag_remove = ETAG_UNSET;
   
  +    conf->enable_mmap = ENABLE_MMAP_UNSET;
  +
       return (void *)conf;
   }
   
  @@ -441,6 +443,10 @@
           conf->etag_bits &= (~ ETAG_NONE);
       }
   
  +    if (new->enable_mmap != ENABLE_MMAP_UNSET) {
  +        conf->enable_mmap = new->enable_mmap;
  +    }
  +
       return (void*)conf;
   }
   
  @@ -1422,6 +1428,29 @@
       return NULL;
   }
   
  +static const char *set_enable_mmap(cmd_parms *cmd, void *d_,
  +                                   const char *arg)
  +{
  +    core_dir_config *d = d_;
  +    const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT);
  +
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    if (strcasecmp(arg, "on") == 0) {
  +        d->enable_mmap = ENABLE_MMAP_ON;
  +    }
  +    else if (strcasecmp(arg, "off") == 0) {
  +        d->enable_mmap = ENABLE_MMAP_OFF;
  +    }
  +    else {
  +        return "parameter must be 'on' or 'off'";
  +    }
  +
  +    return NULL;
  +}
  +
   static const char *satisfy(cmd_parms *cmd, void *c_, const char *arg)
   {
       core_dir_config *c = c_;
  @@ -2871,6 +2900,8 @@
     OR_FILEINFO, "the default MIME type for untypable files"),
   AP_INIT_RAW_ARGS("FileETag", set_etag_bits, NULL, OR_FILEINFO,
     "Specify components used to construct a file's ETag"),
  +AP_INIT_TAKE1("EnableMMAP", set_enable_mmap, NULL, OR_FILEINFO,
  +  "Controls whether memory-mapping may be used to read files"),
   
   /* Old server config file commands */
   
  @@ -3230,6 +3261,11 @@
               e = apr_bucket_file_create(fd, 0, (apr_size_t)r->finfo.size,
                                          r->pool, c->bucket_alloc);
   
  +#if APR_HAS_MMAP
  +        if (d->enable_mmap == ENABLE_MMAP_OFF) {
  +            (void)apr_bucket_file_enable_mmap(e, 0);
  +        }
  +#endif
           APR_BRIGADE_INSERT_TAIL(bb, e);
           e = apr_bucket_eos_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, e);
  
  
  
  1.768     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.767
  retrieving revision 1.768
  diff -u -r1.767 -r1.768
  --- CHANGES	10 May 2002 07:53:43 -0000	1.767
  +++ CHANGES	11 May 2002 23:24:29 -0000	1.768
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.37
   
  +  *) Added EnableMMAP config directive to enable the server
  +     administrator to disable memory-mapping of delivered files
  +     on a per-directory basis.  [Brian Pane]
  +
     *) Performance enhancements for mod_setenvif  [Brian Pane]
   
     *) Fix a mod_ssl build problem on OS/390.  [Jeff Trawick]
  
  
  

Mime
View raw message