summaryrefslogtreecommitdiff
path: root/proto_bin.c
diff options
context:
space:
mode:
authorKevin Lin <developer@kevinlin.info>2021-05-29 22:19:43 -0700
committerdormando <dormando@rydia.net>2021-08-07 01:16:14 -0700
commit617d7cd64d04698b76fee74882627690017e20ad (patch)
treede5c4b129c419ba32e1a403d58871bd0f05da25d /proto_bin.c
parenta54f34f34c3ddef3f6e13f62f3ab673f681cac95 (diff)
downloadmemcached-617d7cd64d04698b76fee74882627690017e20ad.tar.gz
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.
Diffstat (limited to 'proto_bin.c')
-rw-r--r--proto_bin.c1
1 files changed, 1 insertions, 0 deletions
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;
}