You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/11/07 20:07:16 UTC
[trafficserver] branch master updated: Delete H2 stream before
destroy
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new faa3743 Delete H2 stream before destroy
faa3743 is described below
commit faa374373c21a91ddf57f2364b04abc46398e3db
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Nov 6 12:04:36 2017 +0900
Delete H2 stream before destroy
---
proxy/http2/Http2Stream.cc | 19 +++++++++++++------
proxy/http2/Http2Stream.h | 1 +
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 23eff85..40a0834 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -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;
}
@@ -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();
}
}
diff --git a/proxy/http2/Http2Stream.h b/proxy/http2/Http2Stream.h
index fbdef7a..7c1840b 100644
--- a/proxy/http2/Http2Stream.h
+++ b/proxy/http2/Http2Stream.h
@@ -147,6 +147,7 @@ public:
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);
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].