| 484 | } |
| 485 | |
| 486 | bool |
| 487 | Http1ClientSession::attach_server_session(PoolableSession *ssession, bool transaction_done) |
| 488 | { |
| 489 | if (ssession) { |
| 490 | ink_assert(bound_ss == nullptr); |
| 491 | ssession->state = PoolableSession::KA_RESERVED; |
| 492 | bound_ss = ssession; |
| 493 | HttpSsnDbg("[%" PRId64 "] attaching server session [%" PRId64 "] as slave", con_id, ssession->connection_id()); |
| 494 | ink_assert(ssession->get_netvc() != this->get_netvc()); |
| 495 | |
| 496 | // handling potential keep-alive here |
| 497 | clear_session_active(); |
| 498 | |
| 499 | // Since this our slave, issue an IO to detect a close and |
| 500 | // have it call the client session back. This IO also prevent |
| 501 | // the server net connection from calling back a dead sm |
| 502 | SET_HANDLER(&Http1ClientSession::state_keep_alive); |
| 503 | slave_ka_vio = ssession->do_io_read(this, INT64_MAX, ssession->get_remote_reader()->mbuf); |
| 504 | ink_assert(slave_ka_vio != ka_vio); |
| 505 | |
| 506 | // Transfer control of the write side as well |
| 507 | ssession->do_io_write(this, 0, nullptr); |
| 508 | |
| 509 | if (transaction_done) { |
| 510 | ssession->set_inactivity_timeout(HRTIME_SECONDS(trans.get_sm()->t_state.txn_conf->keep_alive_no_activity_timeout_out)); |
| 511 | ssession->cancel_active_timeout(); |
| 512 | } else { |
| 513 | // we are serving from the cache - this could take a while. |
| 514 | ssession->cancel_inactivity_timeout(); |
| 515 | ssession->cancel_active_timeout(); |
| 516 | } |
| 517 | } else { |
| 518 | ink_assert(bound_ss != nullptr); |
| 519 | bound_ss = nullptr; |
| 520 | slave_ka_vio = nullptr; |
| 521 | } |
| 522 | return true; |
| 523 | } |
| 524 | |
| 525 | void |
| 526 | Http1ClientSession::increment_current_active_connections_stat() |
nothing calls this directly
no test coverage detected