Called from the Http1Transaction::release or at the start of a session for the very first transaction from Http1ClientSession::new_connection.
| 413 | // Called from the Http1Transaction::release or at the start of a session for |
| 414 | // the very first transaction from Http1ClientSession::new_connection. |
| 415 | void |
| 416 | Http1ClientSession::release(ProxyTransaction *trans) |
| 417 | { |
| 418 | // When release is called from start() to read the first transaction, get_sm() |
| 419 | // will return null. |
| 420 | HttpSM *sm = trans->get_sm(); |
| 421 | Http1Transaction *h1trans = static_cast<Http1Transaction *>(trans); |
| 422 | if (sm) { |
| 423 | MgmtInt ka_in = trans->get_sm()->t_state.txn_conf->keep_alive_no_activity_timeout_in; |
| 424 | set_inactivity_timeout(HRTIME_SECONDS(ka_in)); |
| 425 | |
| 426 | this->clear_session_active(); |
| 427 | |
| 428 | // Timeout events should be delivered to the session |
| 429 | this->do_io_write(this, 0, nullptr); |
| 430 | } |
| 431 | |
| 432 | h1trans->reset(); |
| 433 | |
| 434 | // Check to see there is remaining data in the |
| 435 | // buffer. If there is, spin up a new state |
| 436 | // machine to process it. Otherwise, issue an |
| 437 | // IO to wait for new data |
| 438 | /* Start the new transaction once we finish completely the current transaction and unroll the stack */ |
| 439 | bool more_to_read = this->_reader->is_read_avail_more_than(0); |
| 440 | if (more_to_read) { |
| 441 | HttpSsnDbg("[%" PRId64 "] data already in buffer, starting new transaction", con_id); |
| 442 | new_transaction(); |
| 443 | } else { |
| 444 | HttpSsnDbg("[%" PRId64 "] initiating io for next header", con_id); |
| 445 | read_state = HCS_KEEP_ALIVE; |
| 446 | SET_HANDLER(&Http1ClientSession::state_keep_alive); |
| 447 | ka_vio = this->do_io_read(this, INT64_MAX, read_buffer); |
| 448 | ink_assert(slave_ka_vio != ka_vio); |
| 449 | |
| 450 | if (_vc) { |
| 451 | // Under heavy traffic ( - e.g. hitting proxy.config.net.max_connections_in limit), calling add_to_keep_alive_queue() |
| 452 | // could free this _vc, session, and transaction. |
| 453 | _vc->cancel_active_timeout(); |
| 454 | _vc->add_to_keep_alive_queue(); |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | ProxyTransaction * |
| 460 | Http1ClientSession::new_transaction() |
no test coverage detected