Select Git revision
test_hom.py
-
Daniel Brown authoredDaniel Brown authored
BOINCInternetFSHandler.cpp 16.35 KiB
/////////////////////////////////////////////////////////////////////////////
// Name: src/msw/urlmsw.cpp
// Purpose: MS-Windows native URL support based on WinINet
// Author: Hajo Kirchhoff
// Modified by:
// Created: 06/11/2003
// RCS-ID: $Id: urlmsw.cpp 58116 2009-01-15 12:45:22Z VZ $
// Copyright: (c) 2003 Hajo Kirchhoff
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Modified for BOINC from wxWidgets 2.8.10 files src/common/fs_mem.cpp and
// src/msw/urlmsw.cpp
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "BOINCInternetFSHandler.h"
#endif
#include "stdwx.h"
#include "BOINCInternetFSHandler.h"
#include "BOINCGUIApp.h"
#include "MainDocument.h"
#include "util.h"
class MemFSHashObj : public wxObject
{
public:
MemFSHashObj(wxInputStream* stream, const wxString& mime, const wxString& key)
{
if (stream) {
wxMemoryOutputStream out;
stream->Read(out);
m_Len = out.GetSize();
m_Data = new char[m_Len];
out.CopyTo(m_Data, m_Len);
} else {
m_Len = 0;
m_Data = NULL;
}
m_Key = key;
m_MimeType = mime;
m_Time = wxDateTime::Now();
}
virtual ~MemFSHashObj()
{
delete[] m_Data;
}
char *m_Data;
size_t m_Len;
wxString m_MimeType;
wxDateTime m_Time;
wxString m_Key;
DECLARE_NO_COPY_CLASS(MemFSHashObj)
};
wxHashTable *CBOINCInternetFSHandler::m_Hash = NULL;
static bool b_ShuttingDown = false;
#ifdef __WXMSW__
// *** code adapted from src/msw/urlmsw.cpp (wxWidgets 2.8.10)
// If OpenURL fails, we probably don't have a connection to
// the Internet, so use a shorter timeout for subsequent calls
// to OpenURL until one succeeds.