mirror of https://github.com/BOINC/boinc.git
Mgr: If network activity is suspended, don't retrieve URL references within notices unless they are already in our cache or in the Windows cache
This commit is contained in:
parent
c5e31b7d95
commit
09ff603a13
|
@ -7829,3 +7829,10 @@ Rom 20 Dec 2012
|
||||||
vboxwrapper.cpp
|
vboxwrapper.cpp
|
||||||
win_build\
|
win_build\
|
||||||
vboxwrapper.vcproj
|
vboxwrapper.vcproj
|
||||||
|
|
||||||
|
Charlie 21 Dec 2012
|
||||||
|
- Mgr: If network activity is suspended, don't retrieve URL references within
|
||||||
|
notices unless they are already in our cache or in the Windows cache.
|
||||||
|
|
||||||
|
clientgui/
|
||||||
|
BOINCInternetFSHandler.cpp
|
||||||
|
|
|
@ -524,12 +524,36 @@ wxFSFile* CBOINCInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wx
|
||||||
wxURL url(right);
|
wxURL url(right);
|
||||||
if (url.GetError() == wxURL_NOERR)
|
if (url.GetError() == wxURL_NOERR)
|
||||||
{
|
{
|
||||||
|
CC_STATUS status;
|
||||||
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||||
|
int retval = pDoc->GetCoreClientStatus(status);
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
wxWinINetURL * winURL = new wxWinINetURL;
|
// Use WinInet fucntions only if network activity not suspended
|
||||||
wxInputStream* m_InputStream = winURL->GetInputStream(&url);
|
// or if the result is already in the Windows internet cache
|
||||||
|
bool CanUseWinInet = true;
|
||||||
|
if ((!retval) && status.network_suspend_reason) {
|
||||||
|
INTERNET_CACHE_ENTRY_INFO cache_info;
|
||||||
|
if (!GetUrlCacheEntryInfo(right.c_str(), sizeof(cache_info))) {
|
||||||
|
CanUseWinInet = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CanUseWinInet) {
|
||||||
|
wxWinINetURL * winURL = new wxWinINetURL;
|
||||||
|
m_InputStream = winURL->GetInputStream(&url);
|
||||||
|
} else {
|
||||||
|
m_InputStream = NULL;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
wxInputStream* m_InputStream = url.GetInputStream();
|
// Mac OS does not cache BOINC's Internet accesses
|
||||||
|
// so just check if network activity os suspended
|
||||||
|
// TODO: Does Linux OS cache BOINC's Internet accesses?
|
||||||
|
if (retval || status.network_suspend_reason) {
|
||||||
|
m_InputStream = NULL;
|
||||||
|
} else {
|
||||||
|
m_InputStream = url.GetInputStream();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
strMIME = url.GetProtocol().GetContentType();
|
strMIME = url.GetProtocol().GetContentType();
|
||||||
if (strMIME == wxEmptyString) {
|
if (strMIME == wxEmptyString) {
|
||||||
|
|
Loading…
Reference in New Issue