Code

frontend: Clear current command on authentication error.
authorSebastian Harl <sh@tokkee.org>
Wed, 23 Apr 2014 20:24:00 +0000 (22:24 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 23 Apr 2014 20:24:00 +0000 (22:24 +0200)
src/frontend/connection.c

index aa0325570171c9f6f0807edc92c953ace241004d..6b785392a1255311d5fae116a1bfb334186534db 100644 (file)
@@ -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;
        }