From d2d162ece35dcf942978f0a481ef2ef3915c2e5d Mon Sep 17 00:00:00 2001 From: Juliusz Stasiewicz Date: Mon, 5 Oct 2020 13:35:10 +0200 Subject: [PATCH] transport: Notify `system.clients` about "protocol_version" --- transport/server.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/transport/server.cc b/transport/server.cc index 9028b2968f..fac681a0c8 100644 --- a/transport/server.cc +++ b/transport/server.cc @@ -371,6 +371,16 @@ cql_server::connection::read_frame() { _version = current_version; throw exceptions::protocol_exception(format("Invalid or unsupported protocol version: {:d}", client_version)); } + + auto client_state_notification_f = std::apply(notify_client_change{}, + std::tuple_cat(make_client_key(_client_state), std::make_tuple(_version))); + + return client_state_notification_f.then_wrapped([this] (future<> f) { + try { + f.get(); + } catch (...) { + clogger.info("exception while setting protocol_version in `system.clients`: {}", std::current_exception()); + } return _read_buf.read_exactly(frame_size() - 1).then([this] (temporary_buffer tail) { temporary_buffer full(frame_size()); full.get_write()[0] = _version; @@ -385,6 +395,7 @@ cql_server::connection::read_frame() { } return make_ready_future(frame); }); + }); }); } else { // Not the first frame, so we know the size.