httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental cache_storage.c cache_util.c mod_cache.c mod_cache.h
Date Sun, 23 Jun 2002 06:10:00 GMT
wrowe       2002/06/22 23:10:00

  Modified:    modules/experimental cache_storage.c cache_util.c
                        mod_cache.c mod_cache.h
  Log:
    No crutches.
  
  Revision  Changes    Path
  1.25      +5 -5      httpd-2.0/modules/experimental/cache_storage.c
  
  Index: cache_storage.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/cache_storage.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- cache_storage.c	22 Jun 2002 19:29:15 -0000	1.24
  +++ cache_storage.c	23 Jun 2002 06:10:00 -0000	1.25
  @@ -209,15 +209,15 @@
                * 
                * RFC2616 13.6 and 14.44 describe the Vary mechanism.
                */
  -            vary = ap_pstrdup(r->pool, ap_table_get(r->headers_out, "Vary"));
  +            vary = apr_pstrdup(r->pool, apr_table_get(r->headers_out, "Vary"));
               while (vary && *vary) {
                   char *name = vary;
                   const char *h1, *h2;
   
                   /* isolate header name */
  -                while (*vary && !ap_isspace(*vary) && (*vary != ','))
  +                while (*vary && !apr_isspace(*vary) && (*vary != ','))
                       ++vary;
  -                while (*vary && (ap_isspace(*vary) || (*vary == ','))) {
  +                while (*vary && (apr_isspace(*vary) || (*vary == ','))) {
                       *vary = '\0';
                       ++vary;
                   }
  @@ -226,8 +226,8 @@
                    * is this header in the request and the header in the cached
                    * request identical? If not, we give up and do a straight get
                    */
  -                h1 = ap_table_get(r->headers_in, name);
  -                h2 = ap_table_get(h->req_hdrs, name);
  +                h1 = apr_table_get(r->headers_in, name);
  +                h2 = apr_table_get(h->req_hdrs, name);
                   if (h1 == h2) {
                       /* both headers NULL, so a match - do nothing */
                   }
  
  
  
  1.17      +12 -11    httpd-2.0/modules/experimental/cache_util.c
  
  Index: cache_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/cache_util.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- cache_util.c	5 Jun 2002 03:45:13 -0000	1.16
  +++ cache_util.c	23 Jun 2002 06:10:00 -0000	1.17
  @@ -194,10 +194,11 @@
        * entity, and it's value is in the past, it has expired.
        * 
        */
  -    cc_cresp = ap_table_get(r->headers_out, "Cache-Control");
  -    cc_req = ap_table_get(r->headers_in, "Cache-Control");
  -    pragma_cresp = ap_table_get(r->headers_out, "Pragma");  /* TODO: pragma_cresp not
being used? */
  -    if ((agestr = ap_table_get(r->headers_out, "Age"))) {
  +    cc_cresp = apr_table_get(r->headers_out, "Cache-Control");
  +    cc_req = apr_table_get(r->headers_in, "Cache-Control");
  +    /* TODO: pragma_cresp not being used? */
  +    pragma_cresp = apr_table_get(r->headers_out, "Pragma");  
  +    if ((agestr = apr_table_get(r->headers_out, "Age"))) {
           age_c = atoi(agestr);
       }
   
  @@ -256,15 +257,15 @@
           (info->expire != APR_DATE_BAD && age < (info->expire - info->date
+ maxstale - minfresh))) {
           /* it's fresh darlings... */
           /* set age header on response */
  -        ap_table_set(r->headers_out, "Age",
  -                     ap_psprintf(r->pool, "%lu", (unsigned long)age));
  +        apr_table_set(r->headers_out, "Age",
  +                      apr_psprintf(r->pool, "%lu", (unsigned long)age));
   
           /* add warning if maxstale overrode freshness calculation */
           if (!((-1 < smaxage && age < smaxage) ||
                 (-1 < maxage && age < maxage) ||
                 (info->expire != APR_DATE_BAD && (info->expire - info->date)
> age))) {
               /* make sure we don't stomp on a previous warning */
  -            ap_table_merge(r->headers_out, "Warning", "110 Response is stale");
  +            apr_table_merge(r->headers_out, "Warning", "110 Response is stale");
           }
           return 1;    /* Cache object is fresh */
       }
  @@ -291,22 +292,22 @@
               i = p - list;
               do
               p++;
  -            while (ap_isspace(*p));
  +            while (apr_isspace(*p));
           }
           else
               i = strlen(list);
   
  -        while (i > 0 && ap_isspace(list[i - 1]))
  +        while (i > 0 && apr_isspace(list[i - 1]))
               i--;
           if (i == len && strncasecmp(list, key, len) == 0) {
               if (val) {
                   p = strchr((char *) list, ',');
  -                while (ap_isspace(*list)) {
  +                while (apr_isspace(*list)) {
                       list++;
                   }
                   if ('=' == list[0])
                       list++;
  -                while (ap_isspace(*list)) {
  +                while (apr_isspace(*list)) {
                       list++;
                   }
                   strncpy(valbuf, list, MIN(p-list, sizeof(valbuf)-1));
  
  
  
  1.45      +16 -16    httpd-2.0/modules/experimental/mod_cache.c
  
  Index: mod_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- mod_cache.c	5 Jun 2002 21:49:16 -0000	1.44
  +++ mod_cache.c	23 Jun 2002 06:10:00 -0000	1.45
  @@ -124,7 +124,7 @@
       cache = (cache_request_rec *) ap_get_module_config(r->request_config, 
                                                          &cache_module);
       if (!cache) {
  -        cache = ap_pcalloc(r->pool, sizeof(cache_request_rec));
  +        cache = apr_pcalloc(r->pool, sizeof(cache_request_rec));
           ap_set_module_config(r->request_config, &cache_module, cache);
       }
   
  @@ -400,7 +400,7 @@
       int rv;
       request_rec *r = f->r;
       char *url = r->unparsed_uri;
  -    const char *cc_out = ap_table_get(r->headers_out, "Cache-Control");
  +    const char *cc_out = apr_table_get(r->headers_out, "Cache-Control");
       const char *exps, *lastmods, *dates, *etag;
       apr_time_t exp, date, lastmod, now;
       apr_size_t size;
  @@ -427,7 +427,7 @@
        * other than the cache handler
        */
       if (!cache) {
  -        cache = ap_pcalloc(r->pool, sizeof(cache_request_rec));
  +        cache = apr_pcalloc(r->pool, sizeof(cache_request_rec));
           ap_set_module_config(r->request_config, &cache_module, cache);
       }
   
  @@ -459,12 +459,12 @@
        * and decides whether this URL should be cached at all. This section is
        * run before the above section.
        */
  -    info = ap_pcalloc(r->pool, sizeof(cache_info));
  +    info = apr_pcalloc(r->pool, sizeof(cache_info));
   
       /* read expiry date; if a bad date, then leave it so the client can
        * read it 
        */
  -    exps = ap_table_get(r->headers_out, "Expires");
  +    exps = apr_table_get(r->headers_out, "Expires");
       if (exps != NULL) {
           if (APR_DATE_BAD == (exp = apr_date_parse_http(exps))) {
               exps = NULL;
  @@ -475,7 +475,7 @@
       }
   
       /* read the last-modified date; if the date is bad, then delete it */
  -    lastmods = ap_table_get(r->headers_out, "Last-Modified");
  +    lastmods = apr_table_get(r->headers_out, "Last-Modified");
       if (lastmods != NULL) {
           if (APR_DATE_BAD == (lastmod = apr_date_parse_http(lastmods))) {
               lastmods = NULL;
  @@ -486,7 +486,7 @@
       }
   
       /* read the etag from the entity */
  -    etag = ap_table_get(r->headers_out, "Etag");
  +    etag = apr_table_get(r->headers_out, "Etag");
   
       /*
        * what responses should we not cache?
  @@ -539,7 +539,7 @@
        * 2) If Cache-Control: must-revalidate is included
        * 3) If Cache-Control: public is included
        */
  -        (ap_table_get(r->headers_in, "Authorization") != NULL &&
  +        (apr_table_get(r->headers_in, "Authorization") != NULL &&
            !(ap_cache_liststr(cc_out, "s-maxage", NULL) || 
              ap_cache_liststr(cc_out, "must-revalidate", NULL) || 
              ap_cache_liststr(cc_out, "public", NULL))
  @@ -658,7 +658,7 @@
        */
   
       /* Read the date. Generate one if one is not supplied */
  -    dates = ap_table_get(r->headers_out, "Date");
  +    dates = apr_table_get(r->headers_out, "Date");
       if (dates != NULL)
           info->date = apr_date_parse_http(dates);
       else
  @@ -674,7 +674,7 @@
           date = now;
           dates = apr_pcalloc(r->pool, MAX_STRING_LEN);
           apr_rfc822_date(dates, now);
  -        ap_table_set(r->headers_out, "Date", dates);
  +        apr_table_set(r->headers_out, "Date", dates);
           ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                        "cache: Added date header");
           info->date = date;
  @@ -743,15 +743,15 @@
   
   static void * create_cache_config(apr_pool_t *p, server_rec *s)
   {
  -    cache_server_conf *ps = ap_pcalloc(p, sizeof(cache_server_conf));
  +    cache_server_conf *ps = apr_pcalloc(p, sizeof(cache_server_conf));
   
       /* 1 if the cache is enabled, 0 otherwise */
       ps->cacheon = 0;
       ps->cacheon_set = 0;
       /* array of URL prefixes for which caching is enabled */
  -    ps->cacheenable = ap_make_array(p, 10, sizeof(struct cache_enable));
  +    ps->cacheenable = apr_array_make(p, 10, sizeof(struct cache_enable));
       /* array of URL prefixes for which caching is disabled */
  -    ps->cachedisable = ap_make_array(p, 10, sizeof(struct cache_disable));
  +    ps->cachedisable = apr_array_make(p, 10, sizeof(struct cache_disable));
       /* maximum time to cache a document */
       ps->maxex = DEFAULT_CACHE_MAXEXPIRE;
       ps->maxex_set = 0;
  @@ -773,7 +773,7 @@
   
   static void * merge_cache_config(apr_pool_t *p, void *basev, void *overridesv)
   {
  -    cache_server_conf *ps = ap_pcalloc(p, sizeof(cache_server_conf));
  +    cache_server_conf *ps = apr_pcalloc(p, sizeof(cache_server_conf));
       cache_server_conf *base = (cache_server_conf *) basev;
       cache_server_conf *overrides = (cache_server_conf *) overridesv;
   
  @@ -781,11 +781,11 @@
       ps->cacheon = 
           (overrides->cacheon_set == 0) ? base->cacheon : overrides->cacheon;
       /* array of URL prefixes for which caching is disabled */
  -    ps->cachedisable = ap_append_arrays(p, 
  +    ps->cachedisable = apr_array_append(p, 
                                           base->cachedisable, 
                                           overrides->cachedisable);
       /* array of URL prefixes for which caching is enabled */
  -    ps->cacheenable = ap_append_arrays(p, 
  +    ps->cacheenable = apr_array_append(p, 
                                          base->cacheenable, 
                                          overrides->cacheenable);
       /* maximum time to cache a document */
  
  
  
  1.29      +0 -1      httpd-2.0/modules/experimental/mod_cache.h
  
  Index: mod_cache.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- mod_cache.h	22 Jun 2002 19:22:40 -0000	1.28
  +++ mod_cache.h	23 Jun 2002 06:10:00 -0000	1.29
  @@ -67,7 +67,6 @@
   
   #include "apr_hooks.h"
   #include "apr.h"
  -#include "apr_compat.h"
   #include "apr_lib.h"
   #include "apr_strings.h"
   #include "apr_buckets.h"
  
  
  

Mime
View raw message