/*
- * $Id$
- *
- * DEBUG: section 16 Cache Manager API
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
*
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
*/
-#include "config.h"
+/* DEBUG: section 16 Cache Manager API */
+
+#include "squid.h"
#include "base/TextException.h"
+#include "comm/Connection.h"
+#include "globals.h"
#include "ipc/UdsOp.h"
#include "mgr/Command.h"
#include "mgr/Filler.h"
#include "mgr/FunAction.h"
#include "mgr/Request.h"
#include "Store.h"
-
+#include "tools.h"
Mgr::FunAction::Pointer
Mgr::FunAction::Create(const Command::Pointer &aCmd, OBJH* aHandler)
}
Mgr::FunAction::FunAction(const Command::Pointer &aCmd, OBJH* aHandler):
- Action(aCmd), handler(aHandler)
+ Action(aCmd), handler(aHandler)
{
Must(handler != NULL);
debugs(16, 5, HERE);
Mgr::FunAction::respond(const Request& request)
{
debugs(16, 5, HERE);
- const int fd = Ipc::ImportFdIntoComm(request.fd, SOCK_STREAM, IPPROTO_TCP, Ipc::fdnHttpSocket);
- Must(fd >= 0);
+ Ipc::ImportFdIntoComm(request.conn, SOCK_STREAM, IPPROTO_TCP, Ipc::fdnHttpSocket);
+ Must(Comm::IsConnOpen(request.conn));
Must(request.requestId != 0);
- AsyncJob::Start(new Mgr::Filler(this, fd, request.requestId));
+ AsyncJob::Start(new Mgr::Filler(this, request.conn, request.requestId));
}
void
{
debugs(16, 5, HERE);
Must(entry != NULL);
- if (UsingSmp() && IamWorkerProcess())
+ if (UsingSmp())
storeAppendPrintf(entry, "by kid%d {\n", KidIdentifier);
handler(entry);
- if (atomic() && UsingSmp() && IamWorkerProcess())
+ if (atomic() && UsingSmp())
storeAppendPrintf(entry, "} by kid%d\n\n", KidIdentifier);
}
+