MCPcopy Create free account
hub / github.com/bumptop/BumpTop / hasInternetConnection

Method hasInternetConnection

trunk/win/Source/BT_FileTransferManager.cpp:647–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645}
646
647bool FileTransferManager::hasInternetConnection(QString url)
648{
649 if (_pfnICC && _pfnIGCC)
650 {
651 // take a look at: IEnumNetworkConnections
652 // for vista/win7
653
654 // otherwise, we are relying on http://support.microsoft.com/kb/242558
655
656 DWORD flags = 0;
657 if (_pfnIGCC(&flags, 0))
658 {
659 // #define FLAG_ICC_FORCE_CONNECTION 0x00000001
660 if (_pfnICC((LPCTSTR)url.utf16(), 0x00000001, 0))
661 return true;
662 else
663 {
664 // #define INTERNET_ERROR_BASE 12000
665 // #define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE+2)
666 // #define ERROR_INTERNET_NAME_NOT_RESOLVED (INTERNET_ERROR_BASE+7)
667 // #define ERROR_INTERNET_CANNOT_CONNECT (INTERNET_ERROR_BASE+29)
668 DWORD err = GetLastError();
669 if (err == 12002 ||
670 err == 12007 ||
671 err == 12029)
672 {
673 return false;
674 }
675 else
676 return true;
677 }
678 }
679 }
680 return false;
681}
682
683void FileTransferManager::removeIncompleteFile( const FileTransfer& transfer )
684{

Callers 10

updateProxySettingsMethod · 0.80
onDropMethod · 0.80
EmailCrashReportFunction · 0.80
requestSourceUpdateMethod · 0.80
handleMessageMethod · 0.80
requestSourceUpdateMethod · 0.80
twitterActionMethod · 0.80
facebookActionMethod · 0.80
getDisplayUrlMethod · 0.80
pUploadStatsThreadMethod · 0.80

Calls 1

GetLastErrorFunction · 0.50

Tested by

no test coverage detected