tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 9d8e0687edaad0ccdcf4c1c84f08bb1e790024dd
parent e43cdb83504fd1387bafa365ab7220540cd332be
Author: agoloman <agoloman@mozilla.com>
Date:   Wed, 19 Nov 2025 18:55:10 +0200

Revert "Bug 1966501 - Check fd is open before use, r=necko-reviewers,valentin" for causing failures @Http3Session.cpp.

This reverts commit e2261ab0464db9bf7c8303d95f033f0d970f1d1a.

Diffstat:
Mnetwerk/base/nsIUDPSocket.idl | 7-------
Mnetwerk/base/nsUDPSocket.cpp | 2--
Mnetwerk/protocol/http/Http3ConnectUDPStream.cpp | 2--
Mnetwerk/protocol/http/Http3Session.cpp | 10----------
Mnetwerk/protocol/http/HttpConnectionUDP.cpp | 5+----
5 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/netwerk/base/nsIUDPSocket.idl b/netwerk/base/nsIUDPSocket.idl @@ -273,13 +273,6 @@ interface nsIUDPSocket : nsISupports */ [noscript, notxpcom] void enableWritePoll(); - /** - * isSocketClosed - * - * @return true when the socket is already closed. - */ - [noscript, notxpcom] boolean isSocketClosed(); - /** * addOutputBytes * diff --git a/netwerk/base/nsUDPSocket.cpp b/netwerk/base/nsUDPSocket.cpp @@ -1222,8 +1222,6 @@ void nsUDPSocket::EnableWritePoll() { mPollFlags = (PR_POLL_WRITE | PR_POLL_READ | PR_POLL_EXCEPT); } -bool nsUDPSocket::IsSocketClosed() { return mFD == nullptr; } - NS_IMETHODIMP nsUDPSocket::SendBinaryStream(const nsACString& aHost, uint16_t aPort, nsIInputStream* aStream) { diff --git a/netwerk/protocol/http/Http3ConnectUDPStream.cpp b/netwerk/protocol/http/Http3ConnectUDPStream.cpp @@ -266,8 +266,6 @@ int64_t Http3ConnectUDPStream::GetFileDescriptor() { return -1; } void Http3ConnectUDPStream::EnableWritePoll() {} -bool Http3ConnectUDPStream::IsSocketClosed() { return mSendState == SEND_DONE; } - void Http3ConnectUDPStream::AddOutputBytes(uint32_t aBytes) {} void Http3ConnectUDPStream::AddInputBytes(uint32_t aBytes) {} diff --git a/netwerk/protocol/http/Http3Session.cpp b/netwerk/protocol/http/Http3Session.cpp @@ -439,11 +439,6 @@ nsresult Http3Session::ProcessInput(nsIUDPSocket* socket) { LOG(("Http3Session::ProcessInput writer=%p [this=%p state=%d]", mUdpConn.get(), this, mState)); - if (!socket || socket->IsSocketClosed()) { - MOZ_DIAGNOSTIC_ASSERT(false, "UDP socket should still be open"); - return NS_ERROR_UNEXPECTED; - } - if (mUseNSPRForIO) { while (true) { nsTArray<uint8_t> data; @@ -1096,11 +1091,6 @@ nsresult Http3Session::ProcessOutput(nsIUDPSocket* socket) { LOG(("Http3Session::ProcessOutput reader=%p, [this=%p]", mUdpConn.get(), this)); - if (!socket || socket->IsSocketClosed()) { - MOZ_DIAGNOSTIC_ASSERT(false, "UDP socket should still be open"); - return NS_ERROR_UNEXPECTED; - } - if (mUseNSPRForIO) { mSocket = socket; nsresult rv = mHttp3Connection->ProcessOutputAndSendUseNSPRForIO( diff --git a/netwerk/protocol/http/HttpConnectionUDP.cpp b/netwerk/protocol/http/HttpConnectionUDP.cpp @@ -619,9 +619,6 @@ void HttpConnectionUDP::Close(nsresult reason, bool aIsShutdown) { socket->Close(); } - MOZ_DIAGNOSTIC_ASSERT(!mHttp3Session || mHttp3Session->IsClosed(), - "Http3Session should already be closed"); - for (const auto& trans : mQueuedHttpConnectTransaction) { trans->Close(reason); } @@ -721,7 +718,7 @@ nsresult HttpConnectionUDP::OnHeadersAvailable(nsAHttpTransaction* trans, // response headers so that it will be ready to receive the new response. if (mIsReused && ((PR_IntervalNow() - mHttp3Session->LastWriteTime()) < k1000ms)) { - CloseTransaction(mHttp3Session, NS_ERROR_NET_RESET); + Close(NS_ERROR_NET_RESET); *reset = true; return NS_OK; }