From 66fae1d81013a2321e7d607a426f834a01b847ce Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 18 Jul 2019 17:52:46 +0200 Subject: Implement a threadsafe & revised version of http2PushedStream. --- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'netwerk/protocol/http/nsHttpConnectionMgr.cpp') diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 907f33436..28df405ad 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -1819,13 +1819,18 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) trans->SetPendingTime(); - Http2PushedStream *pushedStream = trans->GetPushedStream(); - if (pushedStream) { - LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", - trans, pushedStream->Session())); - return pushedStream->Session()-> - AddStream(trans, trans->Priority(), false, nullptr) ? - NS_OK : NS_ERROR_UNEXPECTED; + RefPtr pushedStreamWrapper = + trans->GetPushedStream(); + if (pushedStreamWrapper) { + Http2PushedStream* pushedStream = pushedStreamWrapper->GetStream(); + if (pushedStream) { + LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", trans, + pushedStream->Session())); + return pushedStream->Session()->AddStream(trans, trans->Priority(), false, + nullptr) + ? NS_OK + : NS_ERROR_UNEXPECTED; + } } nsresult rv = NS_OK; -- cgit v1.2.3 From b0a8ed215774469e1d5476d670bb9e2ccbd23ed8 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Fri, 19 Jul 2019 17:28:56 +0200 Subject: Bug 1550498. --- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'netwerk/protocol/http/nsHttpConnectionMgr.cpp') diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 28df405ad..dff08088a 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -504,9 +504,13 @@ nsHttpConnectionMgr::UpdateParam(nsParamName name, uint16_t value) } nsresult -nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo *ci) +nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo* aCI) { - LOG(("nsHttpConnectionMgr::ProcessPendingQ [ci=%s]\n", ci->HashKey().get())); + LOG(("nsHttpConnectionMgr::ProcessPendingQ [ci=%s]\n", aCI->HashKey().get())); + RefPtr ci; + if (aCI) { + ci = aCI->Clone(); + } return PostEvent(&nsHttpConnectionMgr::OnMsgProcessPendingQ, 0, ci); } -- cgit v1.2.3 From b7807cd00b4930639c8d536887a0b54d61c793ee Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Sat, 20 Jul 2019 15:36:09 +0200 Subject: Bug 1548822. --- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'netwerk/protocol/http/nsHttpConnectionMgr.cpp') diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index dff08088a..d402b4104 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -373,8 +373,12 @@ nsHttpConnectionMgr::VerifyTraffic() nsresult nsHttpConnectionMgr::DoShiftReloadConnectionCleanup(nsHttpConnectionInfo *aCI) { + RefPtr ci; + if (aCI) { + ci = aCI->Clone(); + } return PostEvent(&nsHttpConnectionMgr::OnMsgDoShiftReloadConnectionCleanup, - 0, aCI); + 0, ci); } class SpeculativeConnectArgs : public ARefBase @@ -507,8 +511,8 @@ nsresult nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo* aCI) { LOG(("nsHttpConnectionMgr::ProcessPendingQ [ci=%s]\n", aCI->HashKey().get())); - RefPtr ci; - if (aCI) { + RefPtr ci; + if (aCI) { ci = aCI->Clone(); } return PostEvent(&nsHttpConnectionMgr::OnMsgProcessPendingQ, 0, ci); -- cgit v1.2.3 From 91de3341df7e08094e17a34053b8e21c89ab02a7 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 21 Jul 2019 21:30:26 +0200 Subject: Revert "Implement a threadsafe & revised version of http2PushedStream." Backed out because of gcc build failures. This reverts commit 66fae1d81013a2321e7d607a426f834a01b847ce. --- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'netwerk/protocol/http/nsHttpConnectionMgr.cpp') diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index d402b4104..71c19a9ec 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -1827,18 +1827,13 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) trans->SetPendingTime(); - RefPtr pushedStreamWrapper = - trans->GetPushedStream(); - if (pushedStreamWrapper) { - Http2PushedStream* pushedStream = pushedStreamWrapper->GetStream(); - if (pushedStream) { - LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", trans, - pushedStream->Session())); - return pushedStream->Session()->AddStream(trans, trans->Priority(), false, - nullptr) - ? NS_OK - : NS_ERROR_UNEXPECTED; - } + Http2PushedStream *pushedStream = trans->GetPushedStream(); + if (pushedStream) { + LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", + trans, pushedStream->Session())); + return pushedStream->Session()-> + AddStream(trans, trans->Priority(), false, nullptr) ? + NS_OK : NS_ERROR_UNEXPECTED; } nsresult rv = NS_OK; -- cgit v1.2.3 From 17a4b4f6db96b04a62e54146d637b0e10a80acfa Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 21 Jul 2019 23:05:59 +0200 Subject: Implement a threadsafe & revised version of http2PushedStream. This re-applies the patch for this with added typename declaration. --- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'netwerk/protocol/http/nsHttpConnectionMgr.cpp') diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 71c19a9ec..d402b4104 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -1827,13 +1827,18 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) trans->SetPendingTime(); - Http2PushedStream *pushedStream = trans->GetPushedStream(); - if (pushedStream) { - LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", - trans, pushedStream->Session())); - return pushedStream->Session()-> - AddStream(trans, trans->Priority(), false, nullptr) ? - NS_OK : NS_ERROR_UNEXPECTED; + RefPtr pushedStreamWrapper = + trans->GetPushedStream(); + if (pushedStreamWrapper) { + Http2PushedStream* pushedStream = pushedStreamWrapper->GetStream(); + if (pushedStream) { + LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", trans, + pushedStream->Session())); + return pushedStream->Session()->AddStream(trans, trans->Priority(), false, + nullptr) + ? NS_OK + : NS_ERROR_UNEXPECTED; + } } nsresult rv = NS_OK; -- cgit v1.2.3