зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1240269 - Do not open UDP socket during shutdown. r=mcmanus
This commit is contained in:
Родитель
d748989a19
Коммит
874fe57403
|
@ -138,7 +138,7 @@ private:
|
|||
|
||||
private:
|
||||
bool mOffline;
|
||||
bool mOfflineForProfileChange;
|
||||
mozilla::Atomic<bool, mozilla::Relaxed> mOfflineForProfileChange;
|
||||
bool mManageLinkStatus;
|
||||
bool mConnectivity;
|
||||
// If true, the connectivity state will be mirrored by IOService.offline
|
||||
|
@ -150,7 +150,7 @@ private:
|
|||
bool mSettingOffline;
|
||||
bool mSetOfflineValue;
|
||||
|
||||
bool mShutdown;
|
||||
mozilla::Atomic<bool, mozilla::Relaxed> mShutdown;
|
||||
|
||||
nsCOMPtr<nsPISocketTransportService> mSocketTransportService;
|
||||
nsCOMPtr<nsPIDNSService> mDNSService;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "nsError.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIOService.h"
|
||||
#include "prnetdb.h"
|
||||
#include "prio.h"
|
||||
#include "nsNetAddr.h"
|
||||
|
@ -332,6 +333,10 @@ nsUDPSocket::TryAttach()
|
|||
if (!gSocketTransportService)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (gIOService->IsNetTearingDown()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//
|
||||
// find out if it is going to be ok to attach another socket to the STS.
|
||||
// if not then we have to wait for the STS to tell us that it is ok.
|
||||
|
@ -581,6 +586,10 @@ nsUDPSocket::InitWithAddress(const NetAddr *aAddr, nsIPrincipal *aPrincipal,
|
|||
{
|
||||
NS_ENSURE_TRUE(mFD == nullptr, NS_ERROR_ALREADY_INITIALIZED);
|
||||
|
||||
if (gIOService->IsNetTearingDown()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
bool addressReuse = (aOptionalArgc == 1) ? aAddressReuse : true;
|
||||
|
||||
//
|
||||
|
|
Загрузка…
Ссылка в новой задаче