summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 44a02f3)
raw | patch | inline | side by side (parent: 44a02f3)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 4 Nov 2014 07:30:26 +0000 (08:30 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 4 Nov 2014 07:30:26 +0000 (08:30 +0100) |
src/frontend/query.c | patch | blob | history |
diff --git a/src/frontend/query.c b/src/frontend/query.c
index b806dcd52c2489dc4d74bae90ac80f582bf2cf61..7b105e731bf056af321611bc444a2a7287151d6a 100644 (file)
--- a/src/frontend/query.c
+++ b/src/frontend/query.c
if ((! conn) || (conn->cmd != CONNECTION_FETCH))
return -1;
- if (conn->cmd_len < sizeof(type)) {
+ if (conn->cmd_len < sizeof(uint32_t)) {
sdb_log(SDB_LOG_ERR, "frontend: Invalid command length %d for "
"FETCH command", conn->cmd_len);
sdb_strbuf_sprintf(conn->errbuf, "FETCH: Invalid command length %d",
}
type = sdb_proto_get_int(conn->buf, 0);
- strncpy(name, sdb_strbuf_string(conn->buf) + sizeof(type),
- conn->cmd_len - sizeof(type));
+ strncpy(name, sdb_strbuf_string(conn->buf) + sizeof(uint32_t),
+ conn->cmd_len - sizeof(uint32_t));
name[sizeof(name) - 1] = '\0';
/* TODO: support other types besides hosts */
return sdb_fe_exec_fetch(conn, type, name, NULL, /* filter = */ NULL);
const char *matcher;
size_t matcher_len;
- uint32_t type;
+ int type;
int status;
conn_matcher_t m_node = {
if ((! conn) || (conn->cmd != CONNECTION_LOOKUP))
return -1;
- if (conn->cmd_len < sizeof(type)) {
+ if (conn->cmd_len < sizeof(uint32_t)) {
sdb_log(SDB_LOG_ERR, "frontend: Invalid command length %d for "
"LOOKUP command", conn->cmd_len);
sdb_strbuf_sprintf(conn->errbuf, "LOOKUP: Invalid command length %d",
}
type = sdb_proto_get_int(conn->buf, 0);
- matcher = sdb_strbuf_string(conn->buf) + sizeof(type);
- matcher_len = conn->cmd_len - sizeof(type);
+ matcher = sdb_strbuf_string(conn->buf) + sizeof(uint32_t);
+ matcher_len = conn->cmd_len - sizeof(uint32_t);
m = sdb_fe_parse_matcher(matcher, (int)matcher_len);
if (! m) {
char expr[matcher_len + 1];