summaryrefslogtreecommitdiff
path: root/dom/network/TCPSocketParent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/network/TCPSocketParent.cpp')
-rw-r--r--dom/network/TCPSocketParent.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/dom/network/TCPSocketParent.cpp b/dom/network/TCPSocketParent.cpp
index 313d13f759..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)
{
@@ -167,14 +168,27 @@ TCPSocketParent::RecvOpenBind(const nsCString& aRemoteHost,
}
nsCOMPtr<nsISocketTransport> socketTransport;
- rv = sts->CreateTransport(nullptr, 0,
- aRemoteHost, aRemotePort,
- nullptr, getter_AddRefs(socketTransport));
+ if (aUseSSL) {
+ const char* socketTypes[1];
+ socketTypes[0] = "ssl";
+ rv = sts->CreateTransport(socketTypes, 1,
+ aRemoteHost, aRemotePort,
+ nullptr, getter_AddRefs(socketTransport));
+ } else {
+ rv = sts->CreateTransport(nullptr, 0,
+ aRemoteHost, aRemotePort,
+ nullptr, getter_AddRefs(socketTransport));
+ }
+
if (NS_FAILED(rv)) {
FireInteralError(this, __LINE__);
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__);