log when client channels connect successfully

This commit is contained in:
Martin Michelsen
2022-08-11 23:36:30 -07:00
parent d2b9023cfc
commit c592542f07
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -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,
+3
View File
@@ -602,6 +602,9 @@ void ProxyServer::LinkedSession::on_error(Channel& ch, short events) {
auto* session = reinterpret_cast<LinkedSession*>(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",