From: Sebastian Harl Date: Wed, 23 Apr 2014 20:24:00 +0000 (+0200) Subject: frontend: Clear current command on authentication error. X-Git-Tag: sysdb-0.1.0~92 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=8e7384947ee57bbbe58e210be4f6ec04ef8ff508 frontend: Clear current command on authentication error. --- diff --git a/src/frontend/connection.c b/src/frontend/connection.c index aa03255..6b78539 100644 --- a/src/frontend/connection.c +++ b/src/frontend/connection.c @@ -267,6 +267,10 @@ command_handle(sdb_conn_t *conn) 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; }