summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a916bb6)
raw | patch | inline | side by side (parent: a916bb6)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 1 Apr 2014 21:00:44 +0000 (23:00 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 1 Apr 2014 21:00:44 +0000 (23:00 +0200) |
For now, the wire format is: <CONNECTION_LOOKUP>;<len>;<expression>
src/frontend/connection.c | patch | blob | history |
index 91196dcd4448125864073bff616ce24f9d406809..12812c7132b20e35da6954757ddbcb5f6f2e7a7d 100644 (file)
#include "core/object.h"
#include "core/plugin.h"
#include "frontend/connection-private.h"
+#include "frontend/parser.h"
#include "utils/error.h"
#include "utils/strbuf.h"
#include "utils/proto.h"
case CONNECTION_LIST:
status = sdb_fe_list(conn);
break;
+ case CONNECTION_LOOKUP:
+ {
+ sdb_store_matcher_t *m;
+
+ m = sdb_fe_parse_matcher(sdb_strbuf_string(conn->buf),
+ (int)conn->cmd_len);
+ if (! m) {
+ sdb_log(SDB_LOG_ERR, "frontend: Failed to parse expression '%s'",
+ sdb_strbuf_string(conn->buf));
+ status = -1;
+ break;
+ }
+
+ status = sdb_fe_lookup(conn, m);
+ sdb_object_deref(SDB_OBJ(m));
+ break;
+ }
default:
{