]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/ActionParams.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / mgr / ActionParams.cc
1 /*
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 /* DEBUG: section 16 Cache Manager API */
10
11 #include "squid.h"
12 #include "base/TextException.h"
13 #include "ipc/TypedMsgHdr.h"
14 #include "mgr/ActionParams.h"
15
16 Mgr::ActionParams::ActionParams(): httpMethod(Http::METHOD_NONE)
17 {
18 }
19
20 Mgr::ActionParams::ActionParams(const Ipc::TypedMsgHdr &msg)
21 {
22 msg.getString(httpUri);
23
24 String method;
25 msg.getString(method);
26 httpMethod.HttpRequestMethodXXX(method.termedBuf());
27
28 msg.getPod(httpFlags);
29 msg.getString(httpOrigin);
30
31 msg.getString(actionName);
32 msg.getString(userName);
33 msg.getString(password);
34 queryParams.unpack(msg);
35 }
36
37 void
38 Mgr::ActionParams::pack(Ipc::TypedMsgHdr &msg) const
39 {
40 msg.putString(httpUri);
41 String foo(httpMethod.image().toString());
42 msg.putString(foo);
43 msg.putPod(httpFlags);
44 msg.putString(httpOrigin);
45
46 msg.putString(actionName);
47 msg.putString(userName);
48 msg.putString(password);
49 queryParams.pack(msg);
50 }
51