From 617d7cd64d04698b76fee74882627690017e20ad Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Sat, 29 May 2021 22:19:43 -0700 Subject: Implement LOG_CONNEVENTS watcher flag for connection state transitions Add support for `watch connevents` to report opened (`conn_new`) and closed (`conn_close`) client connections. Event log lines indicate the connection's remote IP, remote port, and transport type. `conn_close` events additionally supply a reason for the closing the connection. --- proto_bin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'proto_bin.c') diff --git a/proto_bin.c b/proto_bin.c index 70b196f..a6bf520 100644 --- a/proto_bin.c +++ b/proto_bin.c @@ -1032,6 +1032,7 @@ static void dispatch_bin_command(conn *c, char *extbuf) { write_bin_response(c, NULL, 0, 0, 0); conn_set_state(c, conn_mwrite); c->close_after_write = true; + c->close_reason = NORMAL_CLOSE; } else { protocol_error = 1; } -- cgit v1.2.1