]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/ActionParams.cc
Merged from trunk rev.13534
[thirdparty/squid.git] / src / mgr / ActionParams.cc
1 /*
2 * DEBUG: section 16 Cache Manager API
3 *
4 */
5
6 #include "squid.h"
7 #include "base/TextException.h"
8 #include "ipc/TypedMsgHdr.h"
9 #include "mgr/ActionParams.h"
10
11 Mgr::ActionParams::ActionParams(): httpMethod(Http::METHOD_NONE)
12 {
13 }
14
15 Mgr::ActionParams::ActionParams(const Ipc::TypedMsgHdr &msg)
16 {
17 msg.getString(httpUri);
18
19 String method;
20 msg.getString(method);
21 httpMethod = HttpRequestMethod(method.termedBuf());
22
23 msg.getPod(httpFlags);
24 msg.getString(httpOrigin);
25
26 msg.getString(actionName);
27 msg.getString(userName);
28 msg.getString(password);
29 queryParams.unpack(msg);
30 }
31
32 void
33 Mgr::ActionParams::pack(Ipc::TypedMsgHdr &msg) const
34 {
35 msg.putString(httpUri);
36 String foo(httpMethod.image().toString());
37 msg.putString(foo);
38 msg.putPod(httpFlags);
39 msg.putString(httpOrigin);
40
41 msg.putString(actionName);
42 msg.putString(userName);
43 msg.putString(password);
44 queryParams.pack(msg);
45 }