summaryrefslogtreecommitdiff
path: root/content/llcache.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/llcache.h')
-rw-r--r--content/llcache.h72
1 files changed, 16 insertions, 56 deletions
diff --git a/content/llcache.h b/content/llcache.h
index 8d2411e0a..f9a3016c6 100644
--- a/content/llcache.h
+++ b/content/llcache.h
@@ -30,7 +30,7 @@
#include "utils/errors.h"
#include "utils/nsurl.h"
-struct ssl_cert_info;
+struct cert_chain;
struct fetch_multipart_data;
/** Handle for low-level cache object */
@@ -83,26 +83,23 @@ typedef enum {
* and must be copied if it is desirable to retain.
*/
typedef struct {
- llcache_event_type type; /**< Type of event */
+ llcache_event_type type; /**< Type of event */
union {
struct {
- const uint8_t *buf; /**< Buffer of data */
- size_t len; /**< Length of buffer, in bytes */
- } data; /**< Received data */
+ const uint8_t *buf; /**< Buffer of data */
+ size_t len; /**< Byte length of buffer */
+ } data; /**< Received data */
struct {
- nserror code; /**< The error code */
- const char *msg; /**< Error message */
+ nserror code; /**< The error code */
+ const char *msg; /**< Error message */
} error;
- const char *progress_msg; /**< Progress message */
+ const char *progress_msg; /**< Progress message */
struct {
- nsurl *from; /**< Redirect origin */
- nsurl *to; /**< Redirect target */
- } redirect; /**< Fetch URL redirect occured */
- struct {
- const struct ssl_cert_info *certs; /**< The chain */
- size_t num; /**< Number of certs in chain */
- } certs;
- } data; /**< Event data */
+ nsurl *from; /**< Redirect origin */
+ nsurl *to; /**< Redirect target */
+ } redirect; /**< Fetch URL redirect occured */
+ const struct cert_chain *chain; /**< Certificate chain */
+ } data; /**< Event data */
} llcache_event;
/**
@@ -124,43 +121,6 @@ struct llcache_store_parameters {
size_t limit; /**< The backing store upper bound target size */
size_t hysteresis; /**< The hysteresis around the target size */
-
- /** log2 of the default maximum number of entries the cache
- * can track.
- *
- * If unset this defaults to 16 (65536 entries) The cache
- * control file takes precedence so cache data remains
- * portable between builds with differing defaults.
- */
- unsigned int entry_size;
-
- /** log2 of the default number of entries in the mapping between
- * the url and cache entries.
- *
- * @note This is exposing an internal implementation detail of
- * the filesystem based default backing store implementation.
- * However it is likely any backing store implementation will
- * need some way to map url to cache entries so it is a
- * generally useful configuration value.
- *
- * Too small a value will cause unecessary collisions and
- * cache misses and larger values cause proportionaly larger
- * amounts of memory to be used.
- *
- * The "birthday paradox" means that the hash will experience
- * a collision in every 2^(address_size/2) urls the cache
- * stores.
- *
- * A value of 20 means one object stored in every 1024 will
- * cause a collion and a cache miss while using two megabytes
- * of storage.
- *
- * If unset this defaults to 20 (1048576 entries using two
- * megabytes) The cache control file takes precedence so cache
- * data remains portable between builds with differing
- * defaults.
- */
- unsigned int address_size;
};
/**
@@ -171,17 +131,17 @@ struct llcache_parameters {
size_t hysteresis; /**< The hysteresis around the target size */
/** The minimum lifetime to consider sending objects to backing store.*/
- int minimum_lifetime;
+ int minimum_lifetime;
/** The minimum bandwidth to allow the backing store to
* use in bytes/second
*/
- size_t minimum_bandwidth;
+ size_t minimum_bandwidth;
/** The maximum bandwidth to allow the backing store to use in
* bytes/second
*/
- size_t maximum_bandwidth;
+ size_t maximum_bandwidth;
/** The time quantum over which to calculate the bandwidth values
*/