From 4fe21c14b2a7cb98bb67f21b6c092a2e734d718e Mon Sep 17 00:00:00 2001 From: Michal Novotny Date: Wed, 8 Jan 2020 10:15:48 +0000 Subject: [PATCH] Bug 1601712 - Avoid notifying callback directly from InputStreamShim::AsyncWait() r=dragana Differential Revision: https://phabricator.services.mozilla.com/D59067 --HG-- extra : moz-landing-system : lando --- netwerk/protocol/http/TunnelUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netwerk/protocol/http/TunnelUtils.cpp b/netwerk/protocol/http/TunnelUtils.cpp index 5604f6cb0eea..8caee877eba7 100644 --- a/netwerk/protocol/http/TunnelUtils.cpp +++ b/netwerk/protocol/http/TunnelUtils.cpp @@ -1765,10 +1765,10 @@ class CheckAvailData final : public Runnable { } MOZ_MUST_USE nsresult Dispatch() { - if (OnSocketThread()) { - return Run(); - } - + // Dispatch the event even if we're on socket thread to avoid closing and + // destructing Http2Session in case this call is comming from + // Http2Session::ReadSegments() and the callback closes the transaction in + // OnInputStreamRead(). nsCOMPtr sts = do_GetService("@mozilla.org/network/socket-transport-service;1"); return sts->Dispatch(this, nsIEventTarget::DISPATCH_NORMAL);