7 #include "uniclientconn.h"
25 UniClientConn::NUM_COMMANDS] = {
27 {
"noop",
"noop: verify that the connection is active" },
28 {
"get",
"get <key>: get the value of a key" },
29 {
"set",
"set <key> <value>: sets the value of a key" },
30 {
"setv",
"setv <key> <value> ...: set multiple key-value pairs" },
31 {
"del",
"del <key>: deletes the key" },
32 {
"subt",
"subt <key> <recurse?>: enumerates the children of a key" },
33 {
"hchild",
"hchild <key>: returns whether a key has children" },
34 {
"commit",
"commit: commits changes to disk" },
35 {
"refresh",
"refresh: refresh contents from disk" },
36 {
"quit",
"quit: kills the session nicely" },
37 {
"help",
"help: returns this help text" },
40 {
"OK",
"OK <payload>: reply on command success" },
41 {
"FAIL",
"FAIL <payload>: reply on command failure" },
42 {
"CHILD",
"CHILD <key> TRUE / FALSE: key has children or not" },
43 {
"ONEVAL",
"ONEVAL <key> <value>: reply to a get" },
46 {
"VAL",
"VAL <key> <value>: intermediate reply value of a key" },
47 {
"TEXT",
"TEXT <text>: intermediate reply of a text message" },
50 {
"HELLO",
"HELLO <version> <message>: sent by server on connection" },
51 {
"NOTICE",
"NOTICE <key> <oldval> <newval>: forget key and its children" },
57 log(
WvString(
"UniConf to %s", dst.isnull() && _s->src() ? *_s->src() :
WvString(dst)),
58 WvLog::Debug5), closed(false), version(-1), payloadbuf(
"")
64 UniClientConn::~UniClientConn()
90 char *line =
getline(0,
'\n', 20480);
103 return WvString::null;
107 log(
"Read: %s\n", word);
139 for (
int i = 0; i < NUM_COMMANDS; ++i)
140 if (strcasecmp(cmdinfos[i].name, command.
cstr()) == 0)
175 if (value == WvString::null)