]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mgr/Action.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / mgr / Action.cc
index c5d13e4571536e0eb6e7deae7951b3e25cb1fc57..343dceb49b13dc7db28d9f148dd2001de6c5b69f 100644 (file)
@@ -1,16 +1,19 @@
 /*
- * $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.
  */
 
+/* DEBUG: section 16    Cache Manager API */
+
 #include "squid.h"
 #include "comm/Connection.h"
 #include "HttpReply.h"
 #include "ipc/Port.h"
-#include "mgr/ActionCreator.h"
 #include "mgr/Action.h"
+#include "mgr/ActionCreator.h"
 #include "mgr/ActionParams.h"
 #include "mgr/ActionProfile.h"
 #include "mgr/Command.h"
@@ -19,7 +22,6 @@
 #include "SquidTime.h"
 #include "Store.h"
 
-
 Mgr::Action::Action(const Command::Pointer &aCmd): cmd(aCmd)
 {
     Must(cmd != NULL);
@@ -58,12 +60,12 @@ Mgr::Action::createStoreEntry() const
 }
 
 void
-Mgr::Action::add(const Action& action)
+Mgr::Action::add(const Action &)
 {
 }
 
 void
-Mgr::Action::respond(const Requestrequest)
+Mgr::Action::respond(const Request &request)
 {
     debugs(16, 5, HERE);
 
@@ -82,7 +84,7 @@ Mgr::Action::sendResponse(unsigned int requestId)
     Response response(requestId, this);
     Ipc::TypedMsgHdr message;
     response.pack(message);
-    Ipc::SendMessage(Ipc::coordinatorAddr, message);
+    Ipc::SendMessage(Ipc::Port::CoordinatorAddr(), message);
 }
 
 void
@@ -101,7 +103,7 @@ Mgr::Action::fillEntry(StoreEntry* entry, bool writeHttpHeader)
 
     if (writeHttpHeader) {
         HttpReply *rep = new HttpReply;
-        rep->setHeaders(HTTP_OK, NULL, "text/plain", -1, squid_curtime, squid_curtime);
+        rep->setHeaders(Http::scOkay, NULL, contentType(), -1, squid_curtime, squid_curtime);
         // Allow cachemgr and other XHR scripts access to our version string
         const ActionParams &params = command().params;
         if (params.httpOrigin.size() > 0) {
@@ -121,3 +123,4 @@ Mgr::Action::fillEntry(StoreEntry* entry, bool writeHttpHeader)
     if (atomic())
         entry->complete();
 }
+