| 423 | } |
| 424 | |
| 425 | void Worker::DetachConnection(redis::Connection *conn) { |
| 426 | if (!conn) return; |
| 427 | |
| 428 | removeConnection(conn->GetFD()); |
| 429 | |
| 430 | if (rate_limit_group_) { |
| 431 | bufferevent_remove_from_rate_limit_group(conn->GetBufferEvent()); |
| 432 | } |
| 433 | |
| 434 | auto bev = conn->GetBufferEvent(); |
| 435 | bufferevent_disable(bev, EV_READ | EV_WRITE); |
| 436 | bufferevent_setcb(bev, nullptr, nullptr, nullptr, nullptr); |
| 437 | } |
| 438 | |
| 439 | void Worker::FreeConnection(redis::Connection *conn) { |
| 440 | if (!conn) return; |
no test coverage detected