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/http3/Http3App.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ Http3App::_handle_bidi_stream_on_write_complete(int event, VIO *vio)
txn->handleEvent(event);
}
// FIXME There may be data to read
this->_ssn->remove_transaction(txn);
this->_qc->stream_manager()->delete_stream(stream_id);
this->_streams.erase(stream_id);
delete txn;
}

//
Expand Down
6 changes: 2 additions & 4 deletions proxy/http3/Http3Session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ HQSession::HQSession(NetVConnection *vc) : ProxySession(vc)

HQSession::~HQSession()
{
for (HQTransaction *t = this->_transaction_list.head; t; t = static_cast<HQTransaction *>(t->link.next)) {
delete t;
}
// Transactions should be deleted first before HQSesson gets deleted.
ink_assert(this->_transaction_list.head);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We originally had cleanup code here, but I realized that deleting a transaction modifies the transaction list. I removed the cleanup code since it was just a safety net.

}

void
Expand All @@ -55,7 +54,6 @@ void
HQSession::remove_transaction(HQTransaction *trans)
{
this->_transaction_list.remove(trans);
delete trans;

return;
}
Expand Down
10 changes: 6 additions & 4 deletions proxy/http3/Http3Transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ HQTransaction::HQTransaction(HQSession *session, QUICStreamVCAdapter::IOInfo &in
this->_thread = this_ethread();

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

static_cast<HQSession *>(this->_proxy_ssn)->add_transaction(static_cast<HQTransaction *>(this));
}

HQTransaction::~HQTransaction() {}
HQTransaction::~HQTransaction()
{
static_cast<HQSession *>(this->_proxy_ssn)->remove_transaction(this);
}

void
HQTransaction::set_active_timeout(ink_hrtime timeout_in)
Expand Down Expand Up @@ -295,7 +300,6 @@ HQTransaction::_signal_write_event()
//
Http3Transaction::Http3Transaction(Http3Session *session, QUICStreamVCAdapter::IOInfo &info) : super(session, info)
{
static_cast<HQSession *>(this->_proxy_ssn)->add_transaction(static_cast<HQTransaction *>(this));
QUICStreamId stream_id = this->_info.adapter.stream().id();

this->_header_framer = new Http3HeaderFramer(this, &this->_write_vio, session->local_qpack(), stream_id);
Expand Down Expand Up @@ -513,8 +517,6 @@ Http3Transaction::has_request_body(int64_t content_length, bool is_chunked_set)
//
Http09Transaction::Http09Transaction(Http09Session *session, QUICStreamVCAdapter::IOInfo &info) : super(session, info)
{
static_cast<HQSession *>(this->_proxy_ssn)->add_transaction(static_cast<HQTransaction *>(this));

SET_HANDLER(&Http09Transaction::state_stream_open);
}

Expand Down