21
21
* it under the terms of the GNU General Public License as published by
22
22
* the Free Software Foundation; either version 2 of the License, or
23
23
* (at your option) any later version.
25
25
* This program is distributed in the hope that it will be useful,
26
26
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27
27
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
28
* GNU General Public License for more details.
30
30
* You should have received a copy of the GNU General Public License
31
31
* along with this program; if not, write to the Free Software
32
32
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
37
37
#include "StoreMeta.h"
38
38
#include "StoreMetaUnpacker.h"
40
40
#include "Generic.h"
43
45
#include <stdexcept>
44
48
#include <iostream>
47
54
/* stub functions for parts of squid not factored to be dynamic yet */
57
56
eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)
59
// required by storeKeyPublicByRequest*
60
// XXX: what pulls in storeKeyPublicByRequest?
61
const char *urlCanonical(HttpRequest *) { assert(false); return NULL; }
64
storeAppendPrintf(StoreEntry * e, const char *fmt,...)
74
#include "CacheManager.h"
76
CacheManager::GetInstance()
83
CacheManager::registerAction(char const * action, char const * desc, OBJH * handler, int pw_req_flag, int atomic) {}
85
/* MinGW needs also a stub of death() */
89
std::cout << "Fatal: Signal " << sig;
94
fatal(const char *message)
96
fprintf(stderr, "FATAL: %s\n", message);
61
100
/* end stub functions */
78
uint64_t swap_file_sz;
83
struct DumpStoreMeta : public unary_function<StoreMeta, void>
87
void operator()(StoreMeta const &x)
117
uint64_t swap_file_sz;
122
struct DumpStoreMeta : public unary_function<StoreMeta, void> {
125
void operator()(StoreMeta const &x) {
89
126
switch (x.getType()) {
91
128
case STORE_META_KEY:
95
132
case STORE_META_STD:
96
std::cout << "STD, Size:" << ((struct MetaStd*)x.value)->swap_file_sz <<
97
" Flags: 0x" << std::hex << ((struct MetaStd*)x.value)->flags << std::dec <<
98
" Refcount: " << ((struct MetaStd*)x.value)->refcount <<
133
std::cout << "STD, Size:" << ((struct MetaStd*)x.value)->swap_file_sz <<
134
" Flags: 0x" << std::hex << ((struct MetaStd*)x.value)->flags << std::dec <<
135
" Refcount: " << ((struct MetaStd*)x.value)->refcount <<
102
139
case STORE_META_STD_LFS:
103
std::cout << "STD_LFS, Size: " << ((struct MetaStdLfs*)x.value)->swap_file_sz <<
104
" Flags: 0x" << std::hex << ((struct MetaStdLfs*)x.value)->flags << std::dec <<
105
" Refcount: " << ((struct MetaStdLfs*)x.value)->refcount <<
140
std::cout << "STD_LFS, Size: " << ((struct MetaStdLfs*)x.value)->swap_file_sz <<
141
" Flags: 0x" << std::hex << ((struct MetaStdLfs*)x.value)->flags << std::dec <<
142
" Refcount: " << ((struct MetaStdLfs*)x.value)->refcount <<
109
146
case STORE_META_URL: