summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8e73849)
raw | patch | inline | side by side (parent: 8e73849)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 23 Apr 2014 21:08:19 +0000 (23:08 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 23 Apr 2014 21:08:19 +0000 (23:08 +0200) |
That is, also reset it after an authentication error.
src/frontend/connection.c | patch | blob | history |
index 6b785392a1255311d5fae116a1bfb334186534db..b4f170bb1d759c2289148d2ce31e8006277110eb 100644 (file)
const char *errmsg = "Authentication required";
sdb_connection_send(conn, CONNECTION_ERROR,
(uint32_t)strlen(errmsg), errmsg);
-
- /* remove the command from the buffer */
- if (conn->cmd_len)
- sdb_strbuf_skip(conn->buf, 0, conn->cmd_len);
return -1;
}
sdb_connection_send(conn, CONNECTION_ERROR,
(uint32_t)sdb_strbuf_len(conn->errbuf),
sdb_strbuf_string(conn->errbuf));
-
- /* remove the command from the buffer */
- if (conn->cmd_len)
- sdb_strbuf_skip(conn->buf, 0, conn->cmd_len);
- conn->cmd = CONNECTION_IDLE;
- conn->cmd_len = 0;
return status;
} /* command_handle */
&& (sdb_strbuf_len(conn->buf) >= 2 * sizeof(int32_t)))
command_init(conn);
if ((conn->cmd != CONNECTION_IDLE)
- && (sdb_strbuf_len(conn->buf) >= conn->cmd_len))
+ && (sdb_strbuf_len(conn->buf) >= conn->cmd_len)) {
command_handle(conn);
+ /* remove the command from the buffer */
+ if (conn->cmd_len)
+ sdb_strbuf_skip(conn->buf, 0, conn->cmd_len);
+ conn->cmd = CONNECTION_IDLE;
+ conn->cmd_len = 0;
+ }
+
if (status <= 0)
break;