bug 1094563 - assert necko ip connections made in parent r=jduell (despite the CLOSED TREE)
authorPatrick McManus <mcmanus@ducksong.com>
Wed, 05 Nov 2014 15:01:53 -0500
changeset 241844 3c0bba4064b6223e53b44ec4ec7014b5f7068985
parent 241843 b6785b8cb8127475e1f981704f80871231b4e173
child 241845 4d18de1eb6b36f2f6fa57bbff7cfa6d178c112d7
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs1094563
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1094563 - assert necko ip connections made in parent r=jduell (despite the CLOSED TREE)
netwerk/base/src/nsSocketTransport2.cpp
--- a/netwerk/base/src/nsSocketTransport2.cpp
+++ b/netwerk/base/src/nsSocketTransport2.cpp
@@ -16,16 +16,17 @@
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "plstr.h"
 #include "prerr.h"
 #include "NetworkActivityMonitor.h"
 #include "NSSErrorsService.h"
+#include "mozilla/net/NeckoChild.h"
 #include "mozilla/VisualEventTracer.h"
 #include "nsThreadUtils.h"
 #include "nsISocketProviderService.h"
 #include "nsISocketProvider.h"
 #include "nsISSLSocketControl.h"
 #include "nsIPipe.h"
 #include "nsIProgrammingLanguage.h"
 #include "nsIClassInfoImpl.h"
@@ -1194,16 +1195,25 @@ nsSocketTransport::InitiateSocket()
     nsresult rv;
     bool isLocal;
     IsLocal(&isLocal);
 
     if (gIOService->IsOffline()) {
         if (!isLocal)
             return NS_ERROR_OFFLINE;
     } else if (!isLocal) {
+
+#ifdef DEBUG
+        // all IP networking has to be done from the parent
+        if (NS_SUCCEEDED(mCondition) &&
+            ((mNetAddr.raw.family == AF_INET) || (mNetAddr.raw.family == AF_INET6))) {
+            MOZ_ASSERT(!IsNeckoChild());
+        }
+#endif
+
         if (NS_SUCCEEDED(mCondition) &&
             crashOnNonLocalConnections &&
             !(IsIPAddrAny(&mNetAddr) || IsIPAddrLocal(&mNetAddr))) {
             nsAutoCString ipaddr;
             nsRefPtr<nsNetAddr> netaddr = new nsNetAddr(&mNetAddr);
             netaddr->GetAddress(ipaddr);
             fprintf_stderr(stderr,
                            "FATAL ERROR: Non-local network connections are disabled and a connection "