From: Sebastian Harl Date: Sat, 23 Nov 2013 08:59:14 +0000 (+0100) Subject: frontend: Report back invalid commands. X-Git-Tag: sysdb-0.1.0~336^2~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3e6f9f65568f0043c93ac0c7bdd7eff8ff29e640;p=sysdb.git frontend: Report back invalid commands. --- diff --git a/src/frontend/connection.c b/src/frontend/connection.c index 23bbb33..90361fe 100644 --- a/src/frontend/connection.c +++ b/src/frontend/connection.c @@ -73,9 +73,15 @@ command_handle(sdb_conn_t *conn) status = sdb_session_start(conn); break; default: + { + char errbuf[1024]; sdb_log(SDB_LOG_WARNING, "frontend: Ignoring invalid command"); + snprintf(errbuf, sizeof(errbuf), "Invalid command %#x", conn->cmd); + sdb_connection_send(conn, CONNECTION_ERROR, + (uint32_t)(strlen(errbuf) + 1), errbuf); status = -1; break; + } } /* remove the command from the buffer */