From: Colm MacCarthaigh Date: Sun, 18 Sep 2005 21:17:54 +0000 (+0000) Subject: Backport two small htcacheclean fixes from trunk to the 2.2.x branch; X-Git-Tag: 2.1.8~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7f9b627cd4d4c2be0fb3533ab4ebe4324fa9e9c;p=thirdparty%2Fapache%2Fhttpd.git Backport two small htcacheclean fixes from trunk to the 2.2.x branch; 1.) Open the cache files as binary types, so that htcacheclean can work properly on Windows. 2.) Add an entry in support/README for htcacheclean git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@289977 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/README b/support/README index 80e9cafde0a..020a6bcfcda 100644 --- a/support/README +++ b/support/README @@ -17,6 +17,9 @@ dbmmanage Create and update user authentication files in the faster DBM format used by mod_auth_db. +htcacheclean + Keep the size of mod_disk_cache store within a certain limit. + htdigest Create and update user authentication files used in DIGEST authentification. See mod_auth_digest. diff --git a/support/htcacheclean.c b/support/htcacheclean.c index 6fa1842ca49..622963e99d9 100644 --- a/support/htcacheclean.c +++ b/support/htcacheclean.c @@ -497,8 +497,8 @@ static int process_dir(char *path, apr_pool_t *pool) case HEADERDATA: nextpath = apr_pstrcat(p, path, "/", d->basename, CACHE_HEADER_SUFFIX, NULL); - if (apr_file_open(&fd, nextpath, APR_READ, APR_OS_DEFAULT, - p) == APR_SUCCESS) { + if (apr_file_open(&fd, nextpath, APR_FOPEN_READ | APR_FOPEN_BINARY, + APR_OS_DEFAULT, p) == APR_SUCCESS) { len = sizeof(format); if (apr_file_read_full(fd, &format, len, &len) == APR_SUCCESS) { @@ -570,8 +570,8 @@ static int process_dir(char *path, apr_pool_t *pool) current = apr_time_now(); nextpath = apr_pstrcat(p, path, "/", d->basename, CACHE_HEADER_SUFFIX, NULL); - if (apr_file_open(&fd, nextpath, APR_READ, APR_OS_DEFAULT, - p) == APR_SUCCESS) { + if (apr_file_open(&fd, nextpath, APR_FOPEN_READ | APR_FOPEN_BINARY, + APR_OS_DEFAULT, p) == APR_SUCCESS) { len = sizeof(format); if (apr_file_read_full(fd, &format, len, &len) == APR_SUCCESS) {