You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@apache.org on 2002/04/03 19:34:01 UTC
cvs commit: httpd-2.0/modules/experimental cache_util.c mod_cache.h mod_disk_cache.c
stoddard 02/04/03 09:34:01
Modified: modules/experimental cache_util.c mod_cache.h
mod_disk_cache.c
Log:
Make comments and function name agree with what the functions actually do.
Revision Changes Path
1.15 +5 -10 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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- cache_util.c 3 Apr 2002 05:29:35 -0000 1.14
+++ cache_util.c 3 Apr 2002 17:34:01 -0000 1.15
@@ -210,15 +210,10 @@
}
/*
- * 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 @@
}
/*
- * 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;
1.26 +2 -2 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.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- mod_cache.h 18 Mar 2002 06:37:32 -0000 1.25
+++ mod_cache.h 3 Apr 2002 17:34:01 -0000 1.26
@@ -241,8 +241,8 @@
/**
*
*/
-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);
1.31 +8 -7 httpd-2.0/modules/experimental/mod_disk_cache.c
Index: mod_disk_cache.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_disk_cache.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- mod_disk_cache.c 2 Apr 2002 03:54:38 -0000 1.30
+++ mod_disk_cache.c 3 Apr 2002 17:34:01 -0000 1.31
@@ -226,7 +226,8 @@
/* 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 @@
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 @@
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);