]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mgr/ActionParams.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / mgr / ActionParams.cc
index c05be965285fc8cc4d6b39a97bac178ee786871a..8444ec3050954186310ddb05e45be56374b91fd5 100644 (file)
@@ -1,16 +1,20 @@
 /*
- * $Id$
- *
- * DEBUG: section 16    Cache Manager API
+ * Copyright (C) 1996-2021 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 "ipc/TypedMsgHdr.h"
 #include "mgr/ActionParams.h"
+#include "sbuf/StringConvert.h"
 
-Mgr::ActionParams::ActionParams(): httpMethod(METHOD_NONE)
+Mgr::ActionParams::ActionParams(): httpMethod(Http::METHOD_NONE)
 {
 }
 
@@ -18,25 +22,31 @@ Mgr::ActionParams::ActionParams(const Ipc::TypedMsgHdr &msg)
 {
     msg.getString(httpUri);
 
-    const int m = msg.getInt();
-    Must(METHOD_NONE <= m && m < METHOD_ENUM_END);
-    httpMethod = static_cast<_method_t>(m);
+    String method;
+    msg.getString(method);
+    httpMethod.HttpRequestMethodXXX(method.termedBuf());
 
     msg.getPod(httpFlags);
+    msg.getString(httpOrigin);
 
     msg.getString(actionName);
     msg.getString(userName);
     msg.getString(password);
+    queryParams.unpack(msg);
 }
 
 void
 Mgr::ActionParams::pack(Ipc::TypedMsgHdr &msg) const
 {
     msg.putString(httpUri);
-    msg.putInt(httpMethod);
+    auto foo = SBufToString(httpMethod.image());
+    msg.putString(foo);
     msg.putPod(httpFlags);
+    msg.putString(httpOrigin);
 
     msg.putString(actionName);
     msg.putString(userName);
     msg.putString(password);
+    queryParams.pack(msg);
 }
+