39 return theStart->
data->nodeBuffer.offset;
51 result = theEnd->
data->dataRange().end;
70 debugs(0,
DBG_CRITICAL,
"ERROR: cannot unlink mem_node " << aNode <<
" while write_pending");
74 debugs(19, 8,
this <<
" removing " << aNode);
83 debugs(19, 8,
this <<
" up to " << target_offset);
91 if (theStart->
data->end() > target_offset )
111 size_t copyLen =
min(amount, aNode->
space());
173 std::ostringstream result;
176 debugs (19, 0,
"mem_hdr::debugDump: Current available data is: " << result.str() <<
".");
191 debugs(19, 6,
"memCopy: " <<
this <<
" " << target.
range());
212 fatal_dump(
"Squid has attempted to read data from memory that is not present. This is an indication of of (pre-3.0) code that hasn't been updated to deal with sparse objects in memory. Squid should coredump.allowing to review the cause. Immediately preceding this message is a dump of the available data in the format [start,end). The [ means from the value, the ) means up to the value. I.e. [1,5) means that there are 4 bytes of data, at offsets 1,2,3,4.\n");
216 size_t bytes_to_go = target.
length;
217 char *ptr_to_buf = target.
data;
218 int64_t location = target.
offset;
223 while (p && bytes_to_go > 0) {
225 location, bytes_to_go, ptr_to_buf);
229 if (bytes_to_copy == 0)
230 return target.
length - bytes_to_go;
232 location += bytes_to_copy;
234 ptr_to_buf += bytes_to_copy;
236 bytes_to_go -= bytes_to_copy;
241 return target.
length - bytes_to_go;
247 int64_t currentStart = range.
start;
250 currentStart = curr->end();
252 if (currentStart >= range.
end)
256 return !range.
size();
290 if (candidate && candidate->
canAccept(offset))
305 debugs(19, 6,
"mem_hdr::write: " <<
this <<
" " << writeBuffer.
range() <<
" object end " <<
endOffset());
310 fatal_dump(
"Attempt to overwrite already in-memory data. Preceding this there should be a mem_hdr::write output that lists the attempted write, and the currently present data. Please get a 'backtrace full' from this error - using the generated core, and file a bug report with the squid developers including the last 10 lines of cache.log and the backtrace.\n");
317 int64_t currentOffset = writeBuffer.
offset;
318 char *currentSource = writeBuffer.
data;
319 size_t len = writeBuffer.
length;
322 size_t wrote =
writeAvailable(target, currentOffset, len, currentSource);
325 currentOffset += wrote;
326 currentSource += wrote;
355 return *left < *right ? -1 : 1;
Value const * find(FindValue const &, int(*compare)(FindValue const &a, Value const &b)) const
void remove(Value const &, SPLAYCMP *compare)
SplayNode< V > const * start() const
SplayNode< V > const * finish() const
void visit(ValueVisitor &) const
left-to-right visit of all stored Values
const Value * insert(const Value &, SPLAYCMP *)
void destroy(SPLAYFREE *=DefaultFree)
Range< int64_t > range() const
const Splay< mem_node * > & getNodes() const
bool unlink(mem_node *aNode)
ssize_t copy(StoreIOBuffer const &) const
bool unionNotEmpty(StoreIOBuffer const &)
int64_t freeDataUpto(int64_t)
size_t writeAvailable(mem_node *aNode, int64_t location, size_t amount, char const *source)
mem_node * nodeToRecieve(int64_t offset)
size_t copyAvailable(mem_node *aNode, int64_t location, size_t amount, char *target) const
static Splay< mem_node * >::SPLAYCMP NodeCompare
bool write(StoreIOBuffer const &)
char * NodeGet(mem_node *aNode)
Splay< mem_node * > nodes
int64_t endOffset() const
void appendNode(mem_node *aNode)
bool hasContigousContentRange(Range< int64_t > const &range) const
mem_node * getBlockContainingLocation(int64_t location) const
int64_t lowestOffset() const
Range< int64_t > dataRange() const
bool canAccept(int64_t const &location) const
A const & min(A const &lhs, A const &rhs)
#define debugs(SECTION, LEVEL, CONTENT)
void fatal_dump(const char *message)