#ifndef SQUID_STORECLIENT_H
#define SQUID_STORECLIENT_H
+#include "base/forward.h"
#include "dlink.h"
#include "StoreIOBuffer.h"
#include "StoreIOState.h"
bool pending() const;
STCB *callback_handler;
void *callback_data;
+ CodeContextPointer codeContext; ///< Store client context
} _callback;
};
#include "squid.h"
#include "acl/FilledChecklist.h"
+#include "base/CodeContext.h"
#include "event.h"
#include "globals.h"
#include "HttpReply.h"
PROF_start(InvokeHandlers);
- debugs(90, 3, "InvokeHandlers: " << getMD5Text() );
+ debugs(90, 3, mem_obj->nclients << " clients; " << *this << ' ' << getMD5Text());
/* walk the entire list looking for valid callbacks */
+ const auto savedContext = CodeContext::Current();
for (node = mem_obj->clients.head; node; node = nx) {
sc = (store_client *)node->data;
nx = node->next;
- debugs(90, 3, "StoreEntry::InvokeHandlers: checking client #" << i );
++i;
if (!sc->_callback.pending())
if (sc->flags.disk_io_pending)
continue;
+ CodeContext::Reset(sc->_callback.codeContext);
+ debugs(90, 3, "checking client #" << i);
storeClientCopy2(this, sc);
}
+ CodeContext::Reset(savedContext);
PROF_stop(InvokeHandlers);
}
return callback_handler && callback_data;
}
-store_client::Callback::Callback(STCB *function, void *data) : callback_handler(function), callback_data (data) {}
+store_client::Callback::Callback(STCB *function, void *data):
+ callback_handler(function),
+ callback_data(data),
+ codeContext(CodeContext::Current())
+{
+}
#if USE_DELAY_POOLS
void