summaryrefslogtreecommitdiff
path: root/memcached.h
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 /memcached.h
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 'memcached.h')
-rw-r--r--memcached.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/memcached.h b/memcached.h
index 8648f25..739c939 100644
--- a/memcached.h
+++ b/memcached.h
@@ -245,6 +245,13 @@ enum stop_reasons {
EXIT_NORMALLY
};
+enum close_reasons {
+ ERROR_CLOSE,
+ NORMAL_CLOSE,
+ IDLE_TIMEOUT_CLOSE,
+ SHUTDOWN_CLOSE,
+};
+
#define IS_TCP(x) (x == tcp_transport)
#define IS_UDP(x) (x == udp_transport)
@@ -773,6 +780,7 @@ struct conn {
#endif
enum protocol protocol; /* which protocol this connection speaks */
enum network_transport transport; /* what transport is used by this connection */
+ enum close_reasons close_reason; /* reason for transition into conn_closing */
/* data for UDP clients */
int request_id; /* Incoming UDP request ID, if this is a UDP "connection" */