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.
This commit is contained in:
wolfbeast 2019-03-22 18:41:22 +01:00 committed by Roy Tam
commit ad188bf3c0
4 changed files with 51 additions and 15 deletions

View file

@ -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<nsAHttpTransaction> mTransaction;
nsWeakPtr mWeakTrans; // SpdyConnectTransaction *
nsCOMPtr<nsISupports> mSecInfo;
nsCOMPtr<nsITimer> mTimer;
RefPtr<NudgeTunnelCallback> mNudgeCallback;