From 3403d5f049bf476a495c30026d5002db0e742887 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 22 Mar 2019 18:41:22 +0100 Subject: Close the transaction if PR_Read/PR_Write failed. When PR_Read/PR_White returns -1, we have to use ErrorAccordingToNSPR to get the error code. We need to close the transaction if a real error happens. --- netwerk/protocol/http/TunnelUtils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'netwerk/protocol/http/TunnelUtils.h') diff --git a/netwerk/protocol/http/TunnelUtils.h b/netwerk/protocol/http/TunnelUtils.h index 20cfaf7ee..7e491a0d7 100644 --- a/netwerk/protocol/http/TunnelUtils.h +++ b/netwerk/protocol/http/TunnelUtils.h @@ -121,7 +121,8 @@ public: nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment) override; nsresult GetTransactionSecurityInfo(nsISupports **) override; nsresult NudgeTunnel(NudgeTunnelCallback *callback); - nsresult SetProxiedTransaction(nsAHttpTransaction *aTrans); + MOZ_MUST_USE nsresult SetProxiedTransaction(nsAHttpTransaction *aTrans, + nsAHttpTransaction *aSpdyConnectTransaction = nullptr); void newIODriver(nsIAsyncInputStream *aSocketIn, nsIAsyncOutputStream *aSocketOut, nsIAsyncInputStream **outSocketIn, @@ -153,6 +154,7 @@ private: private: RefPtr mTransaction; + nsWeakPtr mWeakTrans; // SpdyConnectTransaction * nsCOMPtr mSecInfo; nsCOMPtr mTimer; RefPtr mNudgeCallback; -- cgit v1.2.3 From a4013251854b88cacf4eeb221c36e696f468ed64 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 22 Mar 2019 20:11:09 +0100 Subject: Return proper error if the nss layer encounters an error on the http tunnel. --- netwerk/protocol/http/TunnelUtils.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'netwerk/protocol/http/TunnelUtils.h') diff --git a/netwerk/protocol/http/TunnelUtils.h b/netwerk/protocol/http/TunnelUtils.h index 7e491a0d7..4a003082e 100644 --- a/netwerk/protocol/http/TunnelUtils.h +++ b/netwerk/protocol/http/TunnelUtils.h @@ -93,10 +93,11 @@ class TLSFilterTransaction; class NudgeTunnelCallback : public nsISupports { public: - virtual void OnTunnelNudged(TLSFilterTransaction *) = 0; + virtual nsresult OnTunnelNudged(TLSFilterTransaction *) = 0; }; -#define NS_DECL_NUDGETUNNELCALLBACK void OnTunnelNudged(TLSFilterTransaction *) override; +#define NS_DECL_NUDGETUNNELCALLBACK \ + nsresult OnTunnelNudged(TLSFilterTransaction *) override; class TLSFilterTransaction final : public nsAHttpTransaction @@ -170,7 +171,7 @@ private: nsresult mFilterReadCode; bool mForce; - bool mReadSegmentBlocked; + nsresult mReadSegmentReturnValue; uint32_t mNudgeCounter; }; -- cgit v1.2.3