Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proxy/http/ConnectingEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ConnectingEntry::state_http_server_open(int event, void *data)
if (!connect_sms.empty()) {
auto prime_iter = connect_sms.rbegin();
ink_release_assert(prime_iter != connect_sms.rend());
PoolableSession *new_session = (*prime_iter)->create_server_session(netvc, _netvc_read_buffer, _netvc_reader);
PoolableSession *new_session = (*prime_iter)->create_server_session(*netvc, _netvc_read_buffer, _netvc_reader);
netvc = nullptr;
_netvc_read_buffer = nullptr;

Expand Down
14 changes: 6 additions & 8 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1674,11 +1674,11 @@ HttpSM::handle_api_return()
}

PoolableSession *
HttpSM::create_server_session(NetVConnection *netvc, MIOBuffer *netvc_read_buffer, IOBufferReader *netvc_reader)
HttpSM::create_server_session(NetVConnection &netvc, MIOBuffer *netvc_read_buffer, IOBufferReader *netvc_reader)
{
// Figure out what protocol was negotiated
int proto_index = SessionProtocolNameRegistry::INVALID;
if (auto const alpn = netvc->get_service<ALPNSupport>(); alpn) {
if (auto const alpn = netvc.get_service<ALPNSupport>(); alpn) {
proto_index = alpn->get_negotiated_protocol_id();
}
// No ALPN occurred. Assume it was HTTP/1.x and hope for the best
Expand All @@ -1691,14 +1691,12 @@ HttpSM::create_server_session(NetVConnection *netvc, MIOBuffer *netvc_read_buffe
retval->sharing_pool = static_cast<TSServerSessionSharingPoolType>(t_state.http_config_param->server_session_sharing_pool);
retval->sharing_match = static_cast<TSServerSessionSharingMatchMask>(t_state.txn_conf->server_session_sharing_match);
retval->attach_hostname(t_state.current.server->name);
retval->new_connection(netvc, netvc_read_buffer, netvc_reader);
retval->new_connection(&netvc, netvc_read_buffer, netvc_reader);

ATS_PROBE1(new_origin_server_connection, t_state.current.server->name);
retval->set_active();

if (netvc) {
ats_ip_copy(&t_state.server_info.src_addr, netvc->get_local_addr());
}
ats_ip_copy(&t_state.server_info.src_addr, netvc.get_local_addr());

// If origin_max_connections or origin_min_keep_alive_connections is set then we are metering
// the max and or min number of connections per host. Transfer responsibility for this to the
Expand Down Expand Up @@ -1774,7 +1772,7 @@ HttpSM::state_http_server_open(int event, void *data)

} else { // in the case of an intercept plugin don't to the connect timeout change
SMDebug("http_connect", "not setting handler for connection handshake");
this->create_server_txn(this->create_server_session(_netvc, _netvc_read_buffer, _netvc_reader));
this->create_server_txn(this->create_server_session(*_netvc, _netvc_read_buffer, _netvc_reader));
handle_http_server_open();
}
ink_assert(pending_action.empty());
Expand All @@ -1798,7 +1796,7 @@ HttpSM::state_http_server_open(int event, void *data)
case VC_EVENT_WRITE_COMPLETE:
// Update the time out to the regular connection timeout.
SMDebug("http_ss", "Connection handshake complete");
this->create_server_txn(this->create_server_session(_netvc, _netvc_read_buffer, _netvc_reader));
this->create_server_txn(this->create_server_session(*_netvc, _netvc_read_buffer, _netvc_reader));
t_state.current.server->clear_connect_fail();
handle_http_server_open();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion proxy/http/HttpSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class HttpSM : public Continuation, public PluginUserArgs<TS_USER_ARGS_TXN>
// holding the lock for the server session
void attach_server_session();

PoolableSession *create_server_session(NetVConnection *netvc, MIOBuffer *netvc_read_buffer, IOBufferReader *netvc_reader);
PoolableSession *create_server_session(NetVConnection &netvc, MIOBuffer *netvc_read_buffer, IOBufferReader *netvc_reader);
bool create_server_txn(PoolableSession *new_session);

HTTPVersion get_server_version(HTTPHdr &hdr) const;
Expand Down