Code

frontend: Always store errors in the error buffer.
authorSebastian Harl <sh@tokkee.org>
Wed, 23 Apr 2014 21:09:28 +0000 (23:09 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 23 Apr 2014 21:09:28 +0000 (23:09 +0200)
This allows to access the error from other parts of the code.

src/frontend/connection.c

index b4f170bb1d759c2289148d2ce31e8006277110eb..8d7123a1beb13ab77956403659c8be8d81bfdc01 100644 (file)
@@ -265,6 +265,7 @@ command_handle(sdb_conn_t *conn)
 
        if ((! conn->username) && (conn->cmd != CONNECTION_STARTUP)) {
                const char *errmsg = "Authentication required";
+               sdb_strbuf_sprintf(conn->errbuf, errmsg);
                sdb_connection_send(conn, CONNECTION_ERROR,
                                (uint32_t)strlen(errmsg), errmsg);
                return -1;