The CacheEntry data structure holds all the information about one cache entry. The structure is created by the ce_lookup function and destroyed by the ce_free function CacheEntry is defined in the libproxy/cache.h file.
typedef struct _CacheEntry {
CacheState state; /* state of the cache file; DO NOT refer to any
* of the other fields in this C struct if state
* is other than
* CACHE_REFRESH or
* CACHE_RETURN_FROM_CACHE
*/
SYS_FILE fd_in; /* do not use: open cache file for reading */
int fd_out; /* do not use: open (locked) cache file for writing */
struct stat finfo; /* stat info for the cache file */
unsigned char digest[CACHE_DIGEST_LEN]; /* MD5 for the URL */
char * url_dig; /* URL used to for digest; field #8 in CIF */
char * url_cif; /* URL read from CIF file */
char * filname; /* Relative cache file name */
char * dirname; /* Absolute cache directory name */
char * absname; /* Absolute cache file path */
char * lckname; /* Absolute locked cache file path */
char * cifname; /* Absolute CIF path */
int sect_idx; /* Cache section index */
int part_idx; /* Cache partition index */
CSect * section; /* Cache section that this file belongs to */
CPart * partition;/* Cache partition that this file belongs to */
int xfer_time; /* secs *//* Field #2 in CIF */
time_t last_modified;/* GMT *//* Field #3 in CIF */
time_t expires; /* GMT *//* Field #4 in CIF */
time_t last_checked; /* GMT *//* Field #5 in CIF */
long content_length; /* Field #6 in CIF */
char * content_type; /* Field #7 in CIF */
int is_auth; /* Authenticated data -- always do recheck */
int auth_sent; /* Client did send the Authorization header */
long min_size; /* Min size for a cache file (in KB) */
long max_size; /* Max size for a cache file (in KB) */
time_t last_accessed;/* GMT for proxy, local for gc */
time_t created; /* localtime (only used by gc, st_mtime) */
int removed; /* gc only; file was removed from disk */
long bytes; /* from stat(), using this we get hdr len */
long bytes_written; /* Number of bytes written to disk */
long bytes_in_media; /* real fs size taken up */
long blks; /* size in 512 byte blocks */
int category; /* Value category; bigger is better */
int cif_entry_ok; /* CIF entry found and ok */
time_t ims_c; /* GMT; Client -> proxy if-modified-since */
time_t start_time; /* Transfer start time */
int inhibit_caching; /* Bad expires/other reason not to cache */
int corrupt_cache_file; /* Cache file gone corrupt => remove */
int write_aborted; /* True if the cache file write was aborted */
int batch_update; /* We’re doing batch update (no real user) */
char * cache_exclude; /* Hdrs not to write to cache (RE) */
char * cache_replace; /* Hdrs to replace with fresh ones
from 304 response (RE) */
char * cache_nomerge; /* Hdrs not to merge with the
cached ones (RE) */
Session * sn;
Request * rq;
} CacheEntry;