summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorBasilisk-Dev <basiliskdev@protonmail.com>2022-08-20 22:08:28 -0400
committerBasilisk-Dev <basiliskdev@protonmail.com>2022-08-20 22:08:28 -0400
commitaacd52f00f3fc0e466fbd56da3688607cd81377c (patch)
treedc6306b0d021c168efd846bbc7fe36cd4e50fc1f /dom
parent0dad0315dda12ed7db005d0247c5f02e0eccdceb (diff)
downloaduxp-aacd52f00f3fc0e466fbd56da3688607cd81377c.tar.gz
Issue #1991 - backport Mozilla bug 1266667
Diffstat (limited to 'dom')
-rw-r--r--dom/network/PTCPSocket.ipdl3
-rw-r--r--dom/network/TCPSocketChild.cpp5
-rw-r--r--dom/network/TCPSocketChild.h2
-rw-r--r--dom/network/TCPSocketParent.cpp5
-rw-r--r--dom/network/TCPSocketParent.h1
5 files changed, 12 insertions, 4 deletions
diff --git a/dom/network/PTCPSocket.ipdl b/dom/network/PTCPSocket.ipdl
index aa7c51e45f..ea00856029 100644
--- a/dom/network/PTCPSocket.ipdl
+++ b/dom/network/PTCPSocket.ipdl
@@ -44,7 +44,8 @@ parent:
// address specified in |localAddr| and |localPort|.
async OpenBind(nsCString host, uint16_t port,
nsCString localAddr, uint16_t localPort,
- bool useSSL, bool aUseArrayBuffers, nsCString aFilter);
+ bool useSSL, bool reuseAddrPort,
+ bool aUseArrayBuffers, nsCString aFilter);
// When child's send() is called, this message requrests parent to send
// data and update it's trackingNumber.
diff --git a/dom/network/TCPSocketChild.cpp b/dom/network/TCPSocketChild.cpp
index 9e1dce2769..b2b8db78a3 100644
--- a/dom/network/TCPSocketChild.cpp
+++ b/dom/network/TCPSocketChild.cpp
@@ -108,7 +108,7 @@ void
TCPSocketChild::SendWindowlessOpenBind(nsITCPSocketCallback* aSocket,
const nsACString& aRemoteHost, uint16_t aRemotePort,
const nsACString& aLocalHost, uint16_t aLocalPort,
- bool aUseSSL)
+ bool aUseSSL, bool aReuseAddrPort)
{
mSocket = aSocket;
AddIPDLReference();
@@ -117,7 +117,8 @@ TCPSocketChild::SendWindowlessOpenBind(nsITCPSocketCallback* aSocket,
aRemotePort);
PTCPSocketChild::SendOpenBind(nsCString(aRemoteHost), aRemotePort,
nsCString(aLocalHost), aLocalPort,
- aUseSSL, true, mFilterName);
+ aUseSSL, aReuseAddrPort,
+ true, mFilterName);
}
void
diff --git a/dom/network/TCPSocketChild.h b/dom/network/TCPSocketChild.h
index 7e9b59e8b5..46e9b0a90f 100644
--- a/dom/network/TCPSocketChild.h
+++ b/dom/network/TCPSocketChild.h
@@ -55,7 +55,7 @@ public:
void SendWindowlessOpenBind(nsITCPSocketCallback* aSocket,
const nsACString& aRemoteHost, uint16_t aRemotePort,
const nsACString& aLocalHost, uint16_t aLocalPort,
- bool aUseSSL);
+ bool aUseSSL, bool aUseRealtimeOptions);
NS_IMETHOD SendSendArray(nsTArray<uint8_t>& aArray,
uint32_t aTrackingNumber);
void SendSend(const nsACString& aData, uint32_t aTrackingNumber);
diff --git a/dom/network/TCPSocketParent.cpp b/dom/network/TCPSocketParent.cpp
index 27d4d057e7..96eab44510 100644
--- a/dom/network/TCPSocketParent.cpp
+++ b/dom/network/TCPSocketParent.cpp
@@ -149,6 +149,7 @@ TCPSocketParent::RecvOpenBind(const nsCString& aRemoteHost,
const nsCString& aLocalAddr,
const uint16_t& aLocalPort,
const bool& aUseSSL,
+ const bool& aReuseAddrPort,
const bool& aUseArrayBuffers,
const nsCString& aFilter)
{
@@ -184,6 +185,10 @@ TCPSocketParent::RecvOpenBind(const nsCString& aRemoteHost,
return true;
}
+ // in most cases aReuseAddrPort is false, but ICE TCP needs
+ // sockets options set that allow addr/port reuse
+ socketTransport->SetReuseAddrPort(aReuseAddrPort);
+
PRNetAddr prAddr;
if (PR_SUCCESS != PR_InitializeNetAddr(PR_IpAddrAny, aLocalPort, &prAddr)) {
FireInteralError(this, __LINE__);
diff --git a/dom/network/TCPSocketParent.h b/dom/network/TCPSocketParent.h
index 07112f1e2d..e0f987b17f 100644
--- a/dom/network/TCPSocketParent.h
+++ b/dom/network/TCPSocketParent.h
@@ -54,6 +54,7 @@ public:
const nsCString& aLocalAddr,
const uint16_t& aLocalPort,
const bool& aUseSSL,
+ const bool& aReuseAddrPort,
const bool& aUseArrayBuffers,
const nsCString& aFilter) override;