LIBCVER = $(shell /bin/ls /lib/libc.so.? | \
awk -F'.' '{ if (m<$$3) m=$$3;} END { print m} ')
ifeq (6,${LIBCVER})
-SOCKLEN = size_t
+SOCKLEN = socklen_t
endif
CXXFLAGS += -DHAS_PSIGNAL -DLIBCVERSION=$(LIBCVER) -pipe # -Wall -pedantic
-OPT_NORM = -march=pentium -O2
+OPT_NORM = -O2
# if your g++ balks (e.g. SuSE still uses 2.7.2.3)
#CXXFLAGS += -DHAS_PSIGNAL -DLIBCVERSION=$(LIBCVER) -m486
LD = $(CC)
sprintf( timeb, "%08x %08x %08x %08x %04x %5hu ",
temp.timestamp, temp.lastref,
temp.expires, temp.lastmod, temp.flags, temp.refcount );
+ } else if ( meta && (findings = meta->search( STORE_META_STD_LFS )) ) {
+ StoreMetaStdLFS temp;
+ // make data aligned, avoid SIGBUS on RISC machines (ARGH!)
+ memcpy( &temp, findings->data, sizeof(StoreMetaStd) );
+ sprintf( timeb, "%08x %08x %08x %08x %04x %5hu ",
+ temp.timestamp, temp.lastref,
+ temp.expires, temp.lastmod, temp.flags, temp.refcount );
} else {
sprintf( timeb, "%08x %08x %08x %08x %04x %5hu ", -1, -1, -1, -1, 0, 0 );
}
// the URL as part of the list. First, gobble all meta data.
unsigned int offset = addon;
SquidMetaList meta;
- while ( offset < datastart && *(offset+linebuffer) != STORE_META_END ) {
+ while ( offset + addon <= datastart ) {
unsigned int size = 0;
memcpy( &size, linebuffer+offset+sizeof(char), sizeof(unsigned int) );
meta.append( SquidMetaType(*(linebuffer+offset)),
STORE_META_STD, // standard metadata
STORE_META_HITMETERING, // reserved for hit metering
STORE_META_VALID,
- STORE_META_END
+ STORE_META_VARY_HEADERS, // Stores Vary request headers
+ STORE_META_STD_LFS, // standard metadata in lfs format
+ STORE_META_OBJSIZE, // object size, if its known
};
// taken from Squid-2.x
u_short flags;
};
+struct StoreMetaStdLFS {
+ time_t timestamp;
+ time_t lastref;
+ time_t expires;
+ time_t lastmod;
+ uint64_t swap_file_sz;
+ u_short refcount;
+ u_short flags;
+};
+
struct SquidTLV {
// create a shallow reference pointing into the "buffer" variable
// do not copy --> saves times, saves memory.