From c592542f07dd846792993f0866ded0e15cb692dd Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Thu, 11 Aug 2022 23:36:30 -0700 Subject: [PATCH] log when client channels connect successfully --- src/CatSession.cc | 3 +++ src/ProxyServer.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/CatSession.cc b/src/CatSession.cc index 6e8b5639..a16b9053 100644 --- a/src/CatSession.cc +++ b/src/CatSession.cc @@ -111,6 +111,9 @@ void CatSession::dispatch_on_channel_error(Channel& ch, short events) { } void CatSession::on_channel_error(short events) { + if (events & BEV_EVENT_CONNECTED) { + this->log.info("Channel connected"); + } if (events & BEV_EVENT_ERROR) { int err = EVUTIL_SOCKET_ERROR(); this->log.warning("Error %d (%s) in unlinked client stream", err, diff --git a/src/ProxyServer.cc b/src/ProxyServer.cc index b6fe696e..dac375aa 100644 --- a/src/ProxyServer.cc +++ b/src/ProxyServer.cc @@ -602,6 +602,9 @@ void ProxyServer::LinkedSession::on_error(Channel& ch, short events) { auto* session = reinterpret_cast(ch.context_obj); bool is_server_stream = (&ch == &session->server_channel); + if (events & BEV_EVENT_CONNECTED) { + session->log.info("%s channel connected", is_server_stream ? "Server" : "Client"); + } if (events & BEV_EVENT_ERROR) { int err = EVUTIL_SOCKET_ERROR(); session->log.warning("Error %d (%s) in %s stream",