#include "config.h"
#include <pthread.h>
#include <limits.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <cstring>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <set>
#include "Error.h"
#include "InternalErr.h"
#include "ResponseTooBigErr.h"
#include "SignalHandler.h"
#include "HTTPCacheInterruptHandler.h"
#include "HTTPCache.h"
#include "util_mit.h"
#include "debug.h"
Go to the source code of this file.
Namespaces | |
namespace | libdap |
Defines | |
#define | CACHE_EMPTY_ETAG "@cache@" |
#define | CACHE_FOLDER_PCT 10 |
#define | CACHE_GC_PCT 10 |
#define | CACHE_INDEX ".index" |
#define | CACHE_LOC "/tmp/" |
#define | CACHE_LOCK ".lock" |
#define | CACHE_META ".meta" |
#define | CACHE_ROOT "dods-cache/" |
#define | CACHE_TOTAL_SIZE 20 |
#define | DESTROY(m) pthread_mutex_destroy((m)) |
#define | DIR_SEPARATOR_CHAR '/' |
#define | DIR_SEPARATOR_STR "/" |
#define | DUMP_FREQUENCY 10 |
#define | INIT(m) pthread_mutex_init((m), 0) |
#define | LM_EXPIRATION(t) (min((MAX_LM_EXPIRATION), static_cast<int>((t) / 10))) |
#define | LOCK(m) pthread_mutex_lock((m)) |
#define | MAX_CACHE_ENTRY_SIZE 3 |
#define | MAX_LM_EXPIRATION 48*3600 |
#define | MEGA 0x100000L |
#define | MIN_CACHE_TOTAL_SIZE 5 |
#define | MKDIR(a, b) mkdir((a), (b)) |
#define | MKSTEMP(a) mkstemp((a)) |
#define | NO_LM_EXPIRATION 24*3600 |
#define | REMOVE(a) remove((a)) |
#define | TRYLOCK(m) pthread_mutex_trylock((m)) |
#define | UNLOCK(m) pthread_mutex_unlock((m)) |
#define CACHE_EMPTY_ETAG "@cache@" |
Definition at line 100 of file HTTPCache.cc.
#define CACHE_FOLDER_PCT 10 |
#define CACHE_GC_PCT 10 |
#define CACHE_INDEX ".index" |
Definition at line 97 of file HTTPCache.cc.
#define CACHE_LOC "/tmp/" |
Definition at line 94 of file HTTPCache.cc.
#define CACHE_LOCK ".lock" |
Definition at line 98 of file HTTPCache.cc.
#define CACHE_META ".meta" |
#define CACHE_ROOT "dods-cache/" |
Definition at line 95 of file HTTPCache.cc.
#define CACHE_TOTAL_SIZE 20 |
Definition at line 114 of file HTTPCache.cc.
#define DESTROY | ( | m | ) | pthread_mutex_destroy((m)) |
Definition at line 71 of file HTTPCache.cc.
#define DIR_SEPARATOR_CHAR '/' |
Definition at line 86 of file HTTPCache.cc.
#define DIR_SEPARATOR_STR "/" |
Definition at line 87 of file HTTPCache.cc.
#define DUMP_FREQUENCY 10 |
Definition at line 111 of file HTTPCache.cc.
#define INIT | ( | m | ) | pthread_mutex_init((m), 0) |
Definition at line 70 of file HTTPCache.cc.
#define LM_EXPIRATION | ( | t | ) | (min((MAX_LM_EXPIRATION), static_cast<int>((t) / 10))) |
Definition at line 108 of file HTTPCache.cc.
#define LOCK | ( | m | ) | pthread_mutex_lock((m)) |
Definition at line 67 of file HTTPCache.cc.
Referenced by libdap::HTTPCache::get_cache_root(), libdap::HTTPCache::get_cached_response(), libdap::HTTPCache::set_default_expiration(), and libdap::HTTPCache::set_expire_ignored().
#define MAX_CACHE_ENTRY_SIZE 3 |
Definition at line 118 of file HTTPCache.cc.
#define MAX_LM_EXPIRATION 48*3600 |
Definition at line 103 of file HTTPCache.cc.
#define MEGA 0x100000L |
Definition at line 113 of file HTTPCache.cc.
Referenced by libdap::HTTPCache::set_expire_ignored(), and libdap::HTTPCache::set_max_size().
#define MIN_CACHE_TOTAL_SIZE 5 |
#define MKDIR | ( | a, | |||
b | ) | mkdir((a), (b)) |
Definition at line 83 of file HTTPCache.cc.
#define MKSTEMP | ( | a | ) | mkstemp((a)) |
Definition at line 85 of file HTTPCache.cc.
#define NO_LM_EXPIRATION 24*3600 |
Definition at line 102 of file HTTPCache.cc.
#define REMOVE | ( | a | ) | remove((a)) |
Definition at line 84 of file HTTPCache.cc.
#define TRYLOCK | ( | m | ) | pthread_mutex_trylock((m)) |
#define UNLOCK | ( | m | ) | pthread_mutex_unlock((m)) |