| 483 | } |
| 484 | |
| 485 | void Worker::UnpauseConnection(int fd, uint64_t id) { |
| 486 | std::unique_lock<std::mutex> lock(conns_mu_); |
| 487 | auto iter = conns_.find(fd); |
| 488 | // Validate that the connection still exists and has the same id to avoid |
| 489 | // use-after-free if the connection was freed between pause and unpause. |
| 490 | if (iter != conns_.end() && iter->second->GetID() == id) { |
| 491 | iter->second->Unpause(); |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | Status Worker::Reply(int fd, const std::string &reply) { |
| 496 | std::unique_lock<std::mutex> lock(conns_mu_); |
no test coverage detected