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
19 changes: 13 additions & 6 deletions proxy/http2/Http2Stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ Http2Stream::main_event_handler(int event, void *edata)
}
reentrancy_count--;
// Clean stream up if the terminate flag is set and we are at the bottom of the handler stack
if (terminate_stream && reentrancy_count == 0) {
destroy();
}
terminate_if_possible();

return 0;
}
Expand Down Expand Up @@ -359,9 +357,18 @@ Http2Stream::transaction_done()
ink_assert(cross_thread_event == nullptr);
// Schedule the destroy to occur after we unwind here. IF we call directly, may delete with reference on the stack.
terminate_stream = true;
if (terminate_stream && reentrancy_count == 0) {
destroy();
}
terminate_if_possible();
}
}

void
Http2Stream::terminate_if_possible()
{
if (terminate_stream && reentrancy_count == 0) {
Http2ClientSession *h2_parent = static_cast<Http2ClientSession *>(parent);
SCOPED_MUTEX_LOCK(lock, h2_parent->connection_state.mutex, this_ethread());
h2_parent->connection_state.delete_stream(this);
destroy();
}
}

Expand Down
1 change: 1 addition & 0 deletions proxy/http2/Http2Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class Http2Stream : public ProxyClientTransaction
VIO *do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffer, bool owner = false) override;
void do_io_close(int lerrno = -1) override;
void initiating_close();
void terminate_if_possible();
void do_io_shutdown(ShutdownHowTo_t) override {}
void update_read_request(int64_t read_len, bool send_update);
bool update_write_request(IOBufferReader *buf_reader, int64_t write_len, bool send_update);
Expand Down