| 473 | } |
| 474 | |
| 475 | CtPtr ProtocolV1::ready() { |
| 476 | ldout(cct, 25) << __func__ << dendl; |
| 477 | |
| 478 | // make sure no pending tick timer |
| 479 | if (connection->last_tick_id) { |
| 480 | connection->center->delete_time_event(connection->last_tick_id); |
| 481 | } |
| 482 | connection->last_tick_id = connection->center->create_time_event( |
| 483 | connection->inactive_timeout_us, connection->tick_handler); |
| 484 | |
| 485 | connection->write_lock.lock(); |
| 486 | can_write = WriteStatus::CANWRITE; |
| 487 | if (is_queued()) { |
| 488 | connection->center->dispatch_event_external(connection->write_handler); |
| 489 | } |
| 490 | connection->write_lock.unlock(); |
| 491 | connection->maybe_start_delay_thread(); |
| 492 | |
| 493 | state = OPENED; |
| 494 | return wait_message(); |
| 495 | } |
| 496 | |
| 497 | CtPtr ProtocolV1::wait_message() { |
| 498 | if (state != OPENED) { // must have changed due to a replace |
no test coverage detected