fix(memcached): Register memcached listener to handle --maxclients (#2985)

* fix(memcached): Register memcached listener to handle `--maxclients`

We add other listeners to `listeners`, but we seem to have forgotten to
do that to the memcached listener.

* protocol() == REDIS
This commit is contained in:
Shahar Mike 2024-05-01 22:46:16 +03:00 committed by GitHub
parent f20512e8b1
commit 653086c910
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -87,7 +87,8 @@ void AclFamily::StreamUpdatesToAllProactorConnections(const std::string& user, u
auto update_cb = [&]([[maybe_unused]] size_t id, util::Connection* conn) {
DCHECK(conn);
auto connection = static_cast<facade::Connection*>(conn);
if (!connection->IsHttp() && connection->cntx()) {
if (connection->protocol() == facade::Protocol::REDIS && !connection->IsHttp() &&
connection->cntx()) {
connection->SendAclUpdateAsync(
facade::Connection::AclUpdateMessage{user, update_cat, update_commands, update_keys});
}

View file

@ -288,7 +288,8 @@ bool RunEngine(ProactorPool* pool, AcceptServer* acceptor) {
if (mc_port > 0 && !tcp_disabled) {
auto listener = MakeListener(Protocol::MEMCACHE, &service);
acceptor->AddListener(mc_port, listener.release());
acceptor->AddListener(mc_port, listener.get());
listeners.push_back(listener.release());
}
service.Init(acceptor, listeners, opts);