]> granicus.if.org Git - apache/commitdiff
Make comments and function name agree with what the functions actually do.
authorBill Stoddard <stoddard@apache.org>
Wed, 3 Apr 2002 17:34:01 +0000 (17:34 +0000)
committerBill Stoddard <stoddard@apache.org>
Wed, 3 Apr 2002 17:34:01 +0000 (17:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94421 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/cache_util.c
modules/experimental/mod_cache.h
modules/experimental/mod_disk_cache.c

index 530a9c340eaea6074e09545101ed2cfab50ffdaf..6ff7fdf2121d0a31b5a9dc6c84f7ac46e428ce78 100644 (file)
@@ -210,15 +210,10 @@ CACHE_DECLARE(const char *)ap_cache_tokstr(apr_pool_t *p, const char *list, cons
 }
 
 /*
- * XXX TODO:
- * These functions were lifted from mod_proxy
- * Consider putting them in APR or some other common accessable
- * location.
+ * Converts apr_time_t expressed as hex digits to 
+ * a true apr_time_t.
  */
-/*
- * Converts apr_time_t hex digits to a time integer
- */
-CACHE_DECLARE(apr_time_t) ap_cache_hex2msec(const char *x)
+CACHE_DECLARE(apr_time_t) ap_cache_hex2usec(const char *x)
 {
     int i, ch;
     apr_time_t j;
@@ -236,9 +231,9 @@ CACHE_DECLARE(apr_time_t) ap_cache_hex2msec(const char *x)
 }
 
 /*
- * Converts a time integer to apr_time_t hex digits
+ * Converts apr_time_t to apr_time_t expressed as hex digits.
  */
-CACHE_DECLARE(void) ap_cache_msec2hex(apr_time_t j, char *y)
+CACHE_DECLARE(void) ap_cache_usec2hex(apr_time_t j, char *y)
 {
     int i, ch;
 
index dad453c30bbf65c22d0882208e340a6d0675ba71..1b2a3a5928b370d3f4f31f283d9537dc6770329c 100644 (file)
@@ -241,8 +241,8 @@ typedef struct {
 /**
  *
  */
-CACHE_DECLARE(apr_time_t) ap_cache_hex2msec(const char *x);
-CACHE_DECLARE(void) ap_cache_msec2hex(apr_time_t j, char *y);
+CACHE_DECLARE(apr_time_t) ap_cache_hex2usec(const char *x);
+CACHE_DECLARE(void) ap_cache_usec2hex(apr_time_t j, char *y);
 CACHE_DECLARE(char *) generate_name(apr_pool_t *p, int dirlevels, 
                                     int dirlength, 
                                     const char *name);
index 8d55bd09c3e32ee7c9b4e3cae9cf4942d007bfd2..891f47f290ee0970d563ba90dbf6ddcca3381ceb 100644 (file)
@@ -226,7 +226,8 @@ static int file_cache_read_mydata(apr_file_t *fd, cache_info *info,
     /* read the data from the cache file */
     /* format
      * date SP expire SP count CRLF
-     * dates are stored as hex seconds since 1970
+     * dates are stored as a hex representation of apr_time_t (number of
+     * microseconds since 00:00:00 january 1, 1970 UTC)
      */
     rv = apr_file_gets(&urlbuff[0], urllen, fd);
     if (rv != APR_SUCCESS) {
@@ -240,11 +241,11 @@ static int file_cache_read_mydata(apr_file_t *fd, cache_info *info,
         return APR_EGENERAL;
     }
 
-    info->date = ap_cache_hex2msec(urlbuff + offset);
+    info->date = ap_cache_hex2usec(urlbuff + offset);
     offset += (sizeof(info->date)*2) + 1;
-    info->expire = ap_cache_hex2msec(urlbuff + offset);
+    info->expire = ap_cache_hex2usec(urlbuff + offset);
     offset += (sizeof(info->expire)*2) + 1;
-    dobj->version = ap_cache_hex2msec(urlbuff + offset);
+    dobj->version = ap_cache_hex2usec(urlbuff + offset);
     
     /* check that we have the same URL */
     rv = apr_file_gets(&urlbuff[0], urllen, fd);
@@ -283,9 +284,9 @@ static int file_cache_write_mydata(apr_file_t *fd , cache_handle_t *h, request_r
         return 0;
     }
 
-    ap_cache_msec2hex(info->date, dateHexS);
-    ap_cache_msec2hex(info->expire, expireHexS);
-    ap_cache_msec2hex(dobj->version++, verHexS);
+    ap_cache_usec2hex(info->date, dateHexS);
+    ap_cache_usec2hex(info->expire, expireHexS);
+    ap_cache_usec2hex(dobj->version++, verHexS);
     buf = apr_pstrcat(r->pool, dateHexS, " ", expireHexS, " ", verHexS, "\n", NULL);
     amt = strlen(buf);
     rc = apr_file_write(fd, buf, &amt);