Quellcode-Bibliothek nsSOCKSSocketProvider.cpp
Sprache: C
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Per-platform implemenation of OpenTCPSocket helper function // Different platforms have special cases to handle
#ifdefined(XP_WIN) // The proxy host on Windows may be a named pipe uri, in which // case a named-pipe (rather than a socket) should be returned static PRFileDesc* OpenTCPSocket(int32_t family, nsIProxyInfo* proxy) {
PRFileDesc* sock = nullptr;
return sock;
} #elifdefined(XP_UNIX) // The proxy host on UNIX systems may point to a local file uri // in which case we should create an AF_LOCAL (UNIX Domain) socket // instead of the requested AF_INET or AF_INET6 socket.
// Normally,this socket would get thrown out and recreated later on // with the proper family, but we want to do it early here so that // we can enforce seccomp policy to blacklist socket(AF_INET) calls // to prevent the content sandbox from creating network requests static PRFileDesc* OpenTCPSocket(int32_t family, nsIProxyInfo* proxy) {
nsAutoCString proxyHost;
proxy->GetHost(proxyHost); if (StringBeginsWith(proxyHost, "file://"_ns)) {
family = AF_LOCAL;
}
if (NS_FAILED(rv)) rv = NS_ERROR_SOCKET_CREATE_FAILED; return rv;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.