]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mgr/Inquirer.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / mgr / Inquirer.cc
index 4f611dd966878d3a375332fcd1bdc466cb4fe495..9eb412dea68a646828d329b3ef1381c825f9d528 100644 (file)
@@ -1,33 +1,30 @@
 /*
- * $Id$
- *
  * DEBUG: section 16    Cache Manager API
  *
  */
 
-#include "config.h"
+#include "squid.h"
 #include "base/TextException.h"
+#include "comm.h"
 #include "comm/Connection.h"
 #include "comm/Write.h"
 #include "CommCalls.h"
+#include "errorpage.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
 #include "ipc/UdsOp.h"
 #include "mgr/ActionWriter.h"
-#include "mgr/IntParam.h"
-#include "mgr/Inquirer.h"
 #include "mgr/Command.h"
+#include "mgr/Inquirer.h"
+#include "mgr/IntParam.h"
 #include "mgr/Request.h"
 #include "mgr/Response.h"
 #include "SquidTime.h"
-#include "errorpage.h"
 #include <memory>
 #include <algorithm>
 
-
 CBDATA_NAMESPACED_CLASS_INIT(Mgr, Inquirer);
 
-
 Mgr::Inquirer::Inquirer(Action::Pointer anAction,
                         const Request &aCause, const Ipc::StrandCoords &coords):
         Ipc::Inquirer(aCause.clone(), applyQueryParams(coords, aCause.params.queryParams), anAction->atomic() ? 10 : 100),
@@ -70,18 +67,29 @@ Mgr::Inquirer::start()
     Must(Comm::IsConnOpen(conn));
     Must(aggrAction != NULL);
 
+#if HAVE_UNIQUE_PTR
+    std::unique_ptr<MemBuf> replyBuf;
+#else
     std::auto_ptr<MemBuf> replyBuf;
+#endif
     if (strands.empty()) {
         LOCAL_ARRAY(char, url, MAX_URL);
         snprintf(url, MAX_URL, "%s", aggrAction->command().params.httpUri.termedBuf());
         HttpRequest *req = HttpRequest::CreateFromUrl(url);
-        ErrorState *err = errorCon(ERR_INVALID_URL, HTTP_NOT_FOUND, req);
-        std::auto_ptr<HttpReply> reply(err->BuildHttpReply());
+        ErrorState err(ERR_INVALID_URL, Http::scNotFound, req);
+#if HAVE_UNIQUE_PTR
+        std::unique_ptr<HttpReply> reply(err.BuildHttpReply());
+#else
+        std::auto_ptr<HttpReply> reply(err.BuildHttpReply());
+#endif
         replyBuf.reset(reply->pack());
-        errorStateFree(err);
     } else {
+#if HAVE_UNIQUE_PTR
+        std::unique_ptr<HttpReply> reply(new HttpReply);
+#else
         std::auto_ptr<HttpReply> reply(new HttpReply);
-        reply->setHeaders(HTTP_OK, NULL, "text/plain", -1, squid_curtime, squid_curtime);
+#endif
+        reply->setHeaders(Http::scOkay, NULL, "text/plain", -1, squid_curtime, squid_curtime);
         reply->header.putStr(HDR_CONNECTION, "close"); // until we chunk response
         replyBuf.reset(reply->pack());
     }
@@ -171,9 +179,9 @@ Mgr::Inquirer::applyQueryParams(const Ipc::StrandCoords& aStrands, const QueryPa
         }
     }
 
-    debugs(0, 0, HERE << "strands kid IDs = ");
+    debugs(16, 4, HERE << "strands kid IDs = ");
     for (Ipc::StrandCoords::const_iterator iter = sc.begin(); iter != sc.end(); ++iter) {
-        debugs(0, 0, HERE << iter->kidId);
+        debugs(16, 4, HERE << iter->kidId);
     }
 
     return sc;