httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1033952 - in /httpd/httpd/trunk: modules/cache/cache_common.h modules/cache/disk_cache_common.h modules/cache/mod_disk_cache.h support/htcacheclean.c
Date Thu, 11 Nov 2010 14:41:32 GMT
Author: fuankg
Date: Thu Nov 11 14:41:32 2010
New Revision: 1033952

URL: http://svn.apache.org/viewvc?rev=1033952&view=rev
Log:
More splitting as suggested by minfrin.

Added:
    httpd/httpd/trunk/modules/cache/disk_cache_common.h   (with props)
Modified:
    httpd/httpd/trunk/modules/cache/cache_common.h
    httpd/httpd/trunk/modules/cache/mod_disk_cache.h
    httpd/httpd/trunk/support/htcacheclean.c

Modified: httpd/httpd/trunk/modules/cache/cache_common.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_common.h?rev=1033952&r1=1033951&r2=1033952&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_common.h (original)
+++ httpd/httpd/trunk/modules/cache/cache_common.h Thu Nov 11 14:41:32 2010
@@ -16,7 +16,7 @@
 
 /**
  * @file cache_common.h
- * @brief Common Cache vars/structs
+ * @brief Common Cache structs
  *
  * @defgroup Cache_cache  Cache Functions
  * @ingroup  MOD_CACHE
@@ -26,23 +26,8 @@
 #ifndef CACHE_COMMON_H
 #define CACHE_COMMON_H
 
-#define VARY_FORMAT_VERSION 5
-#define DISK_FORMAT_VERSION 6
-
-#define CACHE_HEADER_SUFFIX ".header"
-#define CACHE_DATA_SUFFIX   ".data"
-#define CACHE_VDIR_SUFFIX   ".vary"
-
-#define AP_TEMPFILE_PREFIX "/"
-#define AP_TEMPFILE_BASE   "aptmp"
-#define AP_TEMPFILE_SUFFIX "XXXXXX"
-#define AP_TEMPFILE_BASELEN strlen(AP_TEMPFILE_BASE)
-#define AP_TEMPFILE_NAMELEN strlen(AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX)
-#define AP_TEMPFILE AP_TEMPFILE_PREFIX AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX
-
 /* a cache control header breakdown */
-typedef struct cache_control cache_control_t;
-struct cache_control {
+typedef struct cache_control {
     unsigned int parsed:1;
     unsigned int cache_control:1;
     unsigned int pragma:1;
@@ -64,31 +49,7 @@ struct cache_control {
     apr_int64_t max_stale_value; /* if positive, then set */
     apr_int64_t min_fresh_value; /* if positive, then set */
     apr_int64_t s_maxage_value; /* if positive, then set */
-};
-
-
-typedef struct {
-    /* Indicates the format of the header struct stored on-disk. */
-    apr_uint32_t format;
-    /* The HTTP status code returned for this response.  */
-    int status;
-    /* The size of the entity name that follows. */
-    apr_size_t name_len;
-    /* The number of times we've cached this entity. */
-    apr_size_t entity_version;
-    /* Miscellaneous time values. */
-    apr_time_t date;
-    apr_time_t expire;
-    apr_time_t request_time;
-    apr_time_t response_time;
-    /* The ident of the body file, so we can test the body matches the header */
-    apr_ino_t inode;
-    apr_dev_t device;
-    /* Does this cached request have a body? */
-    int has_body:1;
-    int header_only:1;
-    /* The parsed cache control header */
-    cache_control_t control;
-} disk_cache_info_t;
+} cache_control_t;
 
 #endif /* CACHE_COMMON_H */
+

Added: httpd/httpd/trunk/modules/cache/disk_cache_common.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/disk_cache_common.h?rev=1033952&view=auto
==============================================================================
--- httpd/httpd/trunk/modules/cache/disk_cache_common.h (added)
+++ httpd/httpd/trunk/modules/cache/disk_cache_common.h Thu Nov 11 14:41:32 2010
@@ -0,0 +1,67 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file disk_cache_common.h
+ * @brief Common Disk Cache vars/structs
+ *
+ * @defgroup Cache_cache  Cache Functions
+ * @ingroup  MOD_DISK_CACHE
+ * @{
+ */
+
+#ifndef DISK_CACHE_COMMON_H
+#define DISK_CACHE_COMMON_H
+
+#define VARY_FORMAT_VERSION 5
+#define DISK_FORMAT_VERSION 6
+
+#define CACHE_HEADER_SUFFIX ".header"
+#define CACHE_DATA_SUFFIX   ".data"
+#define CACHE_VDIR_SUFFIX   ".vary"
+
+#define AP_TEMPFILE_PREFIX "/"
+#define AP_TEMPFILE_BASE   "aptmp"
+#define AP_TEMPFILE_SUFFIX "XXXXXX"
+#define AP_TEMPFILE_BASELEN strlen(AP_TEMPFILE_BASE)
+#define AP_TEMPFILE_NAMELEN strlen(AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX)
+#define AP_TEMPFILE AP_TEMPFILE_PREFIX AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX
+
+typedef struct {
+    /* Indicates the format of the header struct stored on-disk. */
+    apr_uint32_t format;
+    /* The HTTP status code returned for this response.  */
+    int status;
+    /* The size of the entity name that follows. */
+    apr_size_t name_len;
+    /* The number of times we've cached this entity. */
+    apr_size_t entity_version;
+    /* Miscellaneous time values. */
+    apr_time_t date;
+    apr_time_t expire;
+    apr_time_t request_time;
+    apr_time_t response_time;
+    /* The ident of the body file, so we can test the body matches the header */
+    apr_ino_t inode;
+    apr_dev_t device;
+    /* Does this cached request have a body? */
+    int has_body:1;
+    int header_only:1;
+    /* The parsed cache control header */
+    cache_control_t control;
+} disk_cache_info_t;
+
+#endif /* DISK_CACHE_COMMON_H */

Propchange: httpd/httpd/trunk/modules/cache/disk_cache_common.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: httpd/httpd/trunk/modules/cache/mod_disk_cache.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_disk_cache.h?rev=1033952&r1=1033951&r2=1033952&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_disk_cache.h (original)
+++ httpd/httpd/trunk/modules/cache/mod_disk_cache.h Thu Nov 11 14:41:32 2010
@@ -17,10 +17,9 @@
 #ifndef MOD_DISK_CACHE_H
 #define MOD_DISK_CACHE_H
 
-#include "mod_cache.h"
 #include "apr_file_io.h"
 
-#include "cache_common.h"
+#include "disk_cache_common.h"
 
 /*
  * include for mod_disk_cache: Disk Based HTTP 1.1 Cache.

Modified: httpd/httpd/trunk/support/htcacheclean.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/htcacheclean.c?rev=1033952&r1=1033951&r2=1033952&view=diff
==============================================================================
--- httpd/httpd/trunk/support/htcacheclean.c (original)
+++ httpd/httpd/trunk/support/htcacheclean.c Thu Nov 11 14:41:32 2010
@@ -36,7 +36,9 @@
 #include "apr_ring.h"
 #include "apr_date.h"
 #include "apr_buckets.h"
+
 #include "../modules/cache/cache_common.h"
+#include "../modules/cache/disk_cache_common.h"
 
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>



Mime
View raw message