From: Sebastian Harl Date: Thu, 7 Nov 2013 06:49:44 +0000 (+0100) Subject: socket frontend: Notify about incomplete commands before closing connections. X-Git-Tag: sysdb-0.1.0~336^2~17 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=7062bfea6bd16380f3a20915f635aff2f5c4305d socket frontend: Notify about incomplete commands before closing connections. --- 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;