summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 25ee464)
raw | patch | inline | side by side (parent: 25ee464)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 11 Nov 2013 08:18:13 +0000 (09:18 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 11 Nov 2013 08:18:13 +0000 (09:18 +0100) |
Else, we might have to wait for more data before being able to process a
command.
command.
src/frontend/connection.c | patch | blob | history |
index 028f3776966b233ec2371b52653f10ce1752c5c0..75ac8c91c845af15dd89efd74fd5778b82821268 100644 (file)
while (42) {
ssize_t status = connection_read(conn);
+
+ if ((! conn->cmd) && (! conn->cmd_len)
+ && (sdb_strbuf_len(conn->buf) >= 2 * sizeof(int32_t)))
+ command_init(conn);
+ if (conn->cmd_len && (sdb_strbuf_len(conn->buf) >= conn->cmd_len))
+ command_handle(conn);
+
if (status <= 0)
break;
n += status;
-
- if (conn->cmd_len && (sdb_strbuf_len(conn->buf) >= conn->cmd_len))
- command_handle(conn);
- else if (sdb_strbuf_len(conn->buf) >= 2 * sizeof(int32_t))
- command_init(conn);
}
return n;
} /* sdb_connection_read */