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/ProxyTransaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define HttpTxnDebug(fmt, ...) SsnDebug(this, "http_txn", fmt, __VA_ARGS__)

ProxyTransaction::ProxyTransaction() : VConnection(nullptr) {}
ProxyTransaction::ProxyTransaction(ProxySession *session) : VConnection(nullptr), _proxy_ssn(session) {}

void
ProxyTransaction::new_transaction(bool from_early_data)
Expand Down
11 changes: 2 additions & 9 deletions proxy/ProxyTransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class HttpSM;
class ProxyTransaction : public VConnection
{
public:
ProxyTransaction();
ProxyTransaction() : VConnection(nullptr) {}
ProxyTransaction(ProxySession *ssn);

/// Virtual Methods
//
Expand Down Expand Up @@ -81,8 +82,6 @@ class ProxyTransaction : public VConnection
virtual bool get_half_close_flag() const;
virtual bool is_chunked_encoding_supported() const;

virtual void set_proxy_ssn(ProxySession *set_proxy_ssn);

// Returns true if there is a request body for this request
virtual bool has_request_body(int64_t content_length, bool is_chunked_set) const;

Expand Down Expand Up @@ -191,12 +190,6 @@ ProxyTransaction::get_proxy_ssn()
return _proxy_ssn;
}

inline void
ProxyTransaction::set_proxy_ssn(ProxySession *new_proxy_ssn)
{
_proxy_ssn = new_proxy_ssn;
}

inline PoolableSession *
ProxyTransaction::get_server_session() const
{
Expand Down
3 changes: 1 addition & 2 deletions proxy/http/Http1ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ink_mutex debug_cs_list_mutex;

ClassAllocator<Http1ClientSession> http1ClientSessionAllocator("http1ClientSessionAllocator");

Http1ClientSession::Http1ClientSession() {}
Http1ClientSession::Http1ClientSession() : super(), trans(this) {}

void
Http1ClientSession::destroy()
Expand Down Expand Up @@ -451,7 +451,6 @@ Http1ClientSession::new_transaction()

read_state = HCS_ACTIVE_READER;

trans.set_proxy_ssn(this);
transact_count++;

trans.new_transaction(read_from_early_data > 0 ? true : false);
Expand Down
2 changes: 1 addition & 1 deletion proxy/http/Http1Transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Http1Transaction : public ProxyTransaction
public:
using super_type = ProxyTransaction;

Http1Transaction() {}
Http1Transaction(ProxySession *session) : super_type(session) {}

////////////////////
// Methods
Expand Down
1 change: 1 addition & 0 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,7 @@ HttpSM::state_http_server_open(int event, void *data)
Http1ServerSession *session = (TS_SERVER_SESSION_SHARING_POOL_THREAD == httpSessionManager.get_pool_type()) ?
THREAD_ALLOC_INIT(httpServerSessionAllocator, mutex->thread_holding) :
httpServerSessionAllocator.alloc();
new (session) Http1ServerSession();
session->sharing_pool = static_cast<TSServerSessionSharingPoolType>(t_state.http_config_param->server_session_sharing_pool);
session->sharing_match = static_cast<TSServerSessionSharingMatchMask>(t_state.txn_conf->server_session_sharing_match);

Expand Down
1 change: 1 addition & 0 deletions proxy/http/HttpSessionAccept.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ HttpSessionAccept::accept(NetVConnection *netvc, MIOBuffer *iobuf, IOBufferReade
}

Http1ClientSession *new_session = THREAD_ALLOC_INIT(http1ClientSessionAllocator, this_ethread());
new (new_session) Http1ClientSession();

new_session->accept_options = static_cast<Options *>(this);
new_session->acl = std::move(acl);
Expand Down
2 changes: 1 addition & 1 deletion proxy/http2/Http2ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ send_connection_event(Continuation *cont, int event, void *edata)
return cont->handleEvent(event, edata);
}

Http2ClientSession::Http2ClientSession() = default;
Http2ClientSession::Http2ClientSession() : super() {}

void
Http2ClientSession::destroy()
Expand Down
3 changes: 1 addition & 2 deletions proxy/http2/Http2ConnectionState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ Http2ConnectionState::create_stream(Http2StreamId new_id, Http2Error &error)
}

Http2Stream *new_stream = THREAD_ALLOC_INIT(http2StreamAllocator, this_ethread());
new_stream->init(new_id, client_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE));
new (new_stream) Http2Stream(ua_session, new_id, client_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE));

ink_assert(nullptr != new_stream);
ink_assert(!stream_list.in(new_stream));
Expand All @@ -1243,7 +1243,6 @@ Http2ConnectionState::create_stream(Http2StreamId new_id, Http2Error &error)
zombie_event = nullptr;
}

new_stream->set_proxy_ssn(ua_session);
new_stream->mutex = new_ProxyMutex();
new_stream->is_first_transaction_flag = get_stream_requests() == 0;
increment_stream_requests();
Expand Down
5 changes: 3 additions & 2 deletions proxy/http2/Http2SessionAccept.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ Http2SessionAccept::accept(NetVConnection *netvc, MIOBuffer *iobuf, IOBufferRead
}

Http2ClientSession *new_session = THREAD_ALLOC_INIT(http2ClientSessionAllocator, this_ethread());
new_session->acl = std::move(session_acl);
new_session->accept_options = &options;
new (new_session) Http2ClientSession();
new_session->acl = std::move(session_acl);
new_session->accept_options = &options;

// Pin session to current ET_NET thread
new_session->setThreadAffinity(this_ethread());
Expand Down
7 changes: 2 additions & 5 deletions proxy/http2/Http2Stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,11 @@

ClassAllocator<Http2Stream> http2StreamAllocator("http2StreamAllocator");

Http2Stream::Http2Stream(Http2StreamId sid, ssize_t initial_rwnd) : _id(sid), _client_rwnd(initial_rwnd)
Http2Stream::Http2Stream(ProxySession *session, Http2StreamId sid, ssize_t initial_rwnd)
: super(session), _id(sid), _client_rwnd(initial_rwnd)
{
SET_HANDLER(&Http2Stream::main_event_handler);
}

void
Http2Stream::init(Http2StreamId sid, ssize_t initial_rwnd)
{
this->mark_milestone(Http2StreamMilestone::OPEN);

this->_sm = nullptr;
Expand Down
5 changes: 2 additions & 3 deletions proxy/http2/Http2Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ class Http2Stream : public ProxyTransaction
const int retry_delay = HRTIME_MSECONDS(10);
using super = ProxyTransaction; ///< Parent type.

Http2Stream(Http2StreamId sid = 0, ssize_t initial_rwnd = Http2::initial_window_size);

void init(Http2StreamId sid, ssize_t initial_rwnd);
Http2Stream() {} // Just to satisfy ClassAllocator
Http2Stream(ProxySession *session, Http2StreamId sid, ssize_t initial_rwnd);

int main_event_handler(int event, void *edata);

Expand Down
4 changes: 1 addition & 3 deletions proxy/http3/Http3Transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@
//
// HQTransaction
//
HQTransaction::HQTransaction(HQSession *session, QUICStreamIO *stream_io) : super(), _stream_io(stream_io)
HQTransaction::HQTransaction(HQSession *session, QUICStreamIO *stream_io) : super(session), _stream_io(stream_io)
{
this->mutex = new_ProxyMutex();
this->_thread = this_ethread();

this->set_proxy_ssn(session);

this->_reader = this->_read_vio_buf.alloc_reader();

HTTPType http_type = HTTP_TYPE_UNKNOWN;
Expand Down