summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee8df3b)
raw | patch | inline | side by side (parent: ee8df3b)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 15 Sep 2014 17:44:13 +0000 (19:44 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 15 Sep 2014 17:44:13 +0000 (19:44 +0200) |
Instead, reserve some space for groups of status/state codes and then use a
new number / block for CONNECTION_DATA.
new number / block for CONNECTION_DATA.
src/include/frontend/proto.h | patch | blob | history |
index c006c49afef15284c98d7da909b5654c8217952b..feac94685356e1f3a0deccc782b341fd01312519 100644 (file)
/* status codes returned to a client */
typedef enum {
+ /*
+ * Generic status and log messages.
+ */
+
/*
* CONNECTION_OK:
* Indicates that a command was successful. The message body will usually
*/
CONNECTION_OK = 0,
- /*
- * CONNECTION_DATA:
- * Indicates that a data query was successful. The message body will
- * contain the type of the data and the result encoded as a JSON string.
- * The type is the same as the command code of the respective command (see
- * below) and is stored as an unsigned 32bit integer in network
- * byte-order. The result may be empty (but the type is still included).
- *
- * 0 32 64
- * +---------------+---------------+
- * | message type | length |
- * +---------------+---------------+
- * | result type | result ... |
- * +---------------+ |
- * | ... |
- */
- CONNECTION_DATA,
-
/*
* CONNECTION_ERROR:
* Indicates that a command has failed. The message body will contain a
* | log message ... |
*/
CONNECTION_LOG,
+
+ /*
+ * Query-result specific messages.
+ */
+
+ /*
+ * CONNECTION_DATA:
+ * Indicates that a data query was successful. The message body will
+ * contain the type of the data and the result encoded as a JSON string.
+ * The type is the same as the command code of the respective command (see
+ * below) and is stored as an unsigned 32bit integer in network
+ * byte-order. The result may be empty (but the type is still included).
+ *
+ * 0 32 64
+ * +---------------+---------------+
+ * | message type | length |
+ * +---------------+---------------+
+ * | result type | result ... |
+ * +---------------+ |
+ * | ... |
+ */
+ CONNECTION_DATA = 100,
} sdb_conn_status_t;
/* accepted commands / state of the connection */
* CONNECTION_EXPR:
* A parsed expression. Only used internally.
*/
- CONNECTION_EXPR,
+ CONNECTION_EXPR = 100,
} sdb_conn_state_t;
#ifdef __cplusplus