mirror of https://github.com/yandex/odyssey.git
odissey: handle basic console SET command
This commit is contained in:
parent
b2a9e5b868
commit
e1557e0c5a
|
@ -63,7 +63,8 @@ enum
|
||||||
OD_LSHOW,
|
OD_LSHOW,
|
||||||
OD_LSTATS,
|
OD_LSTATS,
|
||||||
OD_LSERVERS,
|
OD_LSERVERS,
|
||||||
OD_LCLIENTS
|
OD_LCLIENTS,
|
||||||
|
OD_LSET
|
||||||
};
|
};
|
||||||
|
|
||||||
static od_keyword_t od_console_keywords[] =
|
static od_keyword_t od_console_keywords[] =
|
||||||
|
@ -72,6 +73,7 @@ static od_keyword_t od_console_keywords[] =
|
||||||
od_keyword("stats", OD_LSTATS),
|
od_keyword("stats", OD_LSTATS),
|
||||||
od_keyword("servers", OD_LSERVERS),
|
od_keyword("servers", OD_LSERVERS),
|
||||||
od_keyword("clients", OD_LCLIENTS),
|
od_keyword("clients", OD_LCLIENTS),
|
||||||
|
od_keyword("set", OD_LSET),
|
||||||
{ 0, 0, 0 }
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -498,6 +500,22 @@ od_console_query_show(od_client_t *client, od_parser_t *parser)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
od_console_query_set(od_client_t *client, od_parser_t *parser)
|
||||||
|
{
|
||||||
|
shapito_stream_t *stream = &client->stream;
|
||||||
|
shapito_stream_reset(stream);
|
||||||
|
(void)parser;
|
||||||
|
int rc;
|
||||||
|
rc = shapito_be_write_complete(stream, "SET", 4);
|
||||||
|
if (rc == -1)
|
||||||
|
return -1;
|
||||||
|
rc = shapito_be_write_ready(stream, 'I');
|
||||||
|
if (rc == -1)
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
od_console_query(od_console_t *console, od_msgconsole_t *msg_console)
|
od_console_query(od_console_t *console, od_msgconsole_t *msg_console)
|
||||||
{
|
{
|
||||||
|
@ -537,6 +555,11 @@ od_console_query(od_console_t *console, od_msgconsole_t *msg_console)
|
||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
goto bad_command;
|
goto bad_command;
|
||||||
break;
|
break;
|
||||||
|
case OD_LSET:
|
||||||
|
rc = od_console_query_set(client, &parser);
|
||||||
|
if (rc == -1)
|
||||||
|
goto bad_command;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
goto bad_command;
|
goto bad_command;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue