From 7062bfea6bd16380f3a20915f635aff2f5c4305d Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 7 Nov 2013 07:49:44 +0100 Subject: [PATCH] socket frontend: Notify about incomplete commands before closing connections. --- src/frontend/sock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontend/sock.c b/src/frontend/sock.c index 792c0e4..d7b2ee9 100644 --- a/src/frontend/sock.c +++ b/src/frontend/sock.c @@ -345,10 +345,16 @@ static void connection_destroy(sdb_object_t *obj) { connection_obj_t *conn; + size_t len; assert(obj); conn = CONN(obj); + len = sdb_strbuf_len(conn->buf); + if (len) + sdb_log(SDB_LOG_INFO, "frontend: Discarding incomplete command " + "(%zu bytes left in buffer)", len); + sdb_log(SDB_LOG_DEBUG, "frontend: Closing connection on fd=%i", conn->fd); close(conn->fd); conn->fd = -1; -- 2.30.2