summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cd9116c)
raw | patch | inline | side by side (parent: cd9116c)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 10 Jan 2015 13:03:36 +0000 (14:03 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 10 Jan 2015 13:03:36 +0000 (14:03 +0100) |
OK is sent back on successful STORE commands.
src/tools/sysdb/command.c | patch | blob | history |
index c809c1f8850db46109e7f06b7afd6c99127858cd..440ba41e3b13832574ff0ca42472315023cd7f07 100644 (file)
#include <stdlib.h>
#include <string.h>
+static void
+ok_printer(sdb_strbuf_t *buf)
+{
+ const char *msg = sdb_strbuf_string(buf);
+ if (msg && *msg)
+ printf("%s\n", msg);
+ else
+ printf("OK\n");
+} /* ok_printer */
+
static void
log_printer(sdb_strbuf_t *buf)
{
int status;
void (*printer)(sdb_strbuf_t *);
} response_printers[] = {
+ { SDB_CONNECTION_OK, ok_printer },
{ SDB_CONNECTION_LOG, log_printer },
{ SDB_CONNECTION_DATA, data_printer },
};
break;
}
- if ((status == SDB_CONNECTION_DATA)
+ if ((status == SDB_CONNECTION_OK)
+ || (status == SDB_CONNECTION_DATA)
|| (status == SDB_CONNECTION_ERROR))
break;
}