2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2002-06-28 23:03:52 +00:00
|
|
|
|
|
|
|
#include "nsNativeConnectionHelper.h"
|
|
|
|
#include "nsAutodialWin.h"
|
2008-11-13 15:38:02 +00:00
|
|
|
#include "nsIOService.h"
|
|
|
|
|
2002-06-28 23:03:52 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// API typically invoked on the socket transport thread
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool
|
2014-01-04 15:02:17 +00:00
|
|
|
nsNativeConnectionHelper::OnConnectionFailed(const char16_t* hostName)
|
2002-06-28 23:03:52 +00:00
|
|
|
{
|
2008-11-13 15:38:02 +00:00
|
|
|
if (gIOService->IsLinkUp())
|
2011-10-17 14:59:28 +00:00
|
|
|
return false;
|
2008-11-13 15:38:02 +00:00
|
|
|
|
2009-04-14 04:41:33 +00:00
|
|
|
nsAutodial autodial;
|
2009-11-18 15:20:45 +00:00
|
|
|
if (autodial.ShouldDialOnNetworkError())
|
2002-07-02 04:51:40 +00:00
|
|
|
return NS_SUCCEEDED(autodial.DialDefault(hostName));
|
2009-11-18 15:20:45 +00:00
|
|
|
|
2011-10-17 14:59:28 +00:00
|
|
|
return false;
|
2002-06-28 23:03:52 +00:00
|
|
|
}
|
2007-03-20 01:58:19 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool
|
2007-03-20 01:58:19 +00:00
|
|
|
nsNativeConnectionHelper::IsAutodialEnabled()
|
|
|
|
{
|
2009-04-14 04:41:33 +00:00
|
|
|
nsAutodial autodial;
|
2007-03-20 01:58:19 +00:00
|
|
|
return autodial.Init() == NS_OK && autodial.ShouldDialOnNetworkError();
|
|
|
|
}
|