]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mgr/Action.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / mgr / Action.cc
index 4e1d2e643700b8f88d72fc5e049a14dec238257e..343dceb49b13dc7db28d9f148dd2001de6c5b69f 100644 (file)
@@ -1,8 +1,13 @@
 /*
- * 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"
@@ -55,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);
 
@@ -79,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
@@ -98,7 +103,7 @@ Mgr::Action::fillEntry(StoreEntry* entry, bool writeHttpHeader)
 
     if (writeHttpHeader) {
         HttpReply *rep = new HttpReply;
-        rep->setHeaders(Http::scOkay, 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) {
@@ -118,3 +123,4 @@ Mgr::Action::fillEntry(StoreEntry* entry, bool writeHttpHeader)
     if (atomic())
         entry->complete();
 }
+