mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
[Network] refactoring
This commit is contained in:
@ -56,11 +56,6 @@ namespace NSNetwork
|
||||
m_cData = NULL;
|
||||
m_nSize = 0;
|
||||
|
||||
m_sResponse = L"";
|
||||
|
||||
|
||||
m_func_onComplete = nullptr;
|
||||
m_func_onProgress = nullptr;
|
||||
|
||||
m_bIsExit = nullptr;
|
||||
}
|
||||
@ -79,11 +74,6 @@ namespace NSNetwork
|
||||
m_cData = cData;
|
||||
m_nSize = nSize;
|
||||
|
||||
m_sResponse = L"";
|
||||
|
||||
|
||||
m_func_onComplete = nullptr;
|
||||
m_func_onProgress = nullptr;
|
||||
|
||||
m_bIsExit = nullptr;
|
||||
}
|
||||
@ -102,11 +92,6 @@ namespace NSNetwork
|
||||
m_cData = NULL;
|
||||
m_nSize = 0;
|
||||
|
||||
m_sResponse = L"";
|
||||
|
||||
|
||||
m_func_onComplete = nullptr;
|
||||
m_func_onProgress = nullptr;
|
||||
|
||||
m_bIsExit = nullptr;
|
||||
}
|
||||
@ -146,10 +131,10 @@ namespace NSNetwork
|
||||
const unsigned char* m_cData; // Данные в сыром виде для выгрузки
|
||||
int m_nSize; // Размер данных
|
||||
|
||||
std::wstring m_sResponse; // Ответ сервера
|
||||
std::wstring m_sResponse = L""; // Ответ сервера
|
||||
|
||||
std::function<void(int)> m_func_onComplete;
|
||||
std::function<void(int)> m_func_onProgress;
|
||||
std::function<void(int)> m_func_onComplete = nullptr;
|
||||
std::function<void(int)> m_func_onProgress = nullptr;
|
||||
|
||||
std::atomic<bool>* m_bIsExit; // Для остановки и выхода потока
|
||||
};
|
||||
|
||||
@ -60,19 +60,16 @@ namespace NSNetwork
|
||||
CFileTransporterBaseWin(const std::wstring &sDownloadFileUrl, bool bDelete = true) :
|
||||
CFileTransporterBase(sDownloadFileUrl, bDelete)
|
||||
{
|
||||
m_pFile = NULL;
|
||||
}
|
||||
|
||||
CFileTransporterBaseWin(const std::wstring &sUploadUrl, const unsigned char* cData, const int nSize) :
|
||||
CFileTransporterBase(sUploadUrl, cData, nSize)
|
||||
{
|
||||
m_pFile = NULL;
|
||||
}
|
||||
|
||||
CFileTransporterBaseWin(const std::wstring &sUploadUrl, const std::wstring &sUploadFilePath) :
|
||||
CFileTransporterBase(sUploadUrl, sUploadFilePath)
|
||||
{
|
||||
m_pFile = NULL;
|
||||
}
|
||||
|
||||
virtual ~CFileTransporterBaseWin()
|
||||
@ -124,7 +121,7 @@ namespace NSNetwork
|
||||
}
|
||||
|
||||
protected:
|
||||
FILE *m_pFile; // Хэндл на временный файл
|
||||
FILE * m_pFile = nullptr; // Хэндл на временный файл
|
||||
unsigned int _DownloadFile(std::wstring sFileUrl)
|
||||
{
|
||||
// Проверяем состояние соединения
|
||||
@ -490,18 +487,18 @@ namespace NSNetwork
|
||||
};
|
||||
|
||||
CFileTransporter_private::CFileTransporter_private(const std::wstring &sDownloadFileUrl, bool bDelete)
|
||||
: m_pInternal(new CFileTransporterBaseWin(sDownloadFileUrl, bDelete))
|
||||
{
|
||||
m_pInternal = new CFileTransporterBaseWin(sDownloadFileUrl, bDelete);
|
||||
}
|
||||
|
||||
CFileTransporter_private::CFileTransporter_private(const std::wstring &sUploadUrl, const unsigned char* cData, const int nSize)
|
||||
: m_pInternal(new CFileTransporterBaseWin(sUploadUrl, cData, nSize))
|
||||
{
|
||||
m_pInternal = new CFileTransporterBaseWin(sUploadUrl, cData, nSize);
|
||||
}
|
||||
|
||||
CFileTransporter_private::CFileTransporter_private(const std::wstring &sUploadUrl, const std::wstring &sUploadFilePath)
|
||||
: m_pInternal(new CFileTransporterBaseWin(sUploadUrl, sUploadFilePath))
|
||||
{
|
||||
m_pInternal = new CFileTransporterBaseWin(sUploadUrl, sUploadFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user