From: Bill Stoddard Date: Wed, 3 Apr 2002 17:34:01 +0000 (+0000) Subject: Make comments and function name agree with what the functions actually do. X-Git-Tag: 2.0.35~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=087c7712a7469aa08cbf21144b06538977bb6543;p=apache Make comments and function name agree with what the functions actually do. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94421 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/cache_util.c b/modules/experimental/cache_util.c index 530a9c340e..6ff7fdf212 100644 --- a/modules/experimental/cache_util.c +++ b/modules/experimental/cache_util.c @@ -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; diff --git a/modules/experimental/mod_cache.h b/modules/experimental/mod_cache.h index dad453c30b..1b2a3a5928 100644 --- a/modules/experimental/mod_cache.h +++ b/modules/experimental/mod_cache.h @@ -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); diff --git a/modules/experimental/mod_disk_cache.c b/modules/experimental/mod_disk_cache.c index 8d55bd09c3..891f47f290 100644 --- a/modules/experimental/mod_disk_cache.c +++ b/modules/experimental/mod_disk_cache.c @@ -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);