[Network] add callBack onProcess for curl (both variant)

This commit is contained in:
Vladimir Gorshenkov
2022-01-18 15:00:27 +03:00
parent 8f9d36085b
commit 2194dd5899
4 changed files with 72 additions and 10 deletions

View File

@ -8,6 +8,7 @@ QT -= core
QT -= gui
CORE_ROOT_DIR = $$PWD/../../..
PWD_ROOT_DIR = $$PWD
include(../../../Common/base.pri)
@ -22,7 +23,8 @@ DEFINES += KERNEL_USE_DYNAMIC_LIBRARY
core_windows {
DEFINES += _RWSTD_NO_SETRLIMIT
}
CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/lib/win_64/debug
CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/lib/linux_64/debug
#CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/lib/win_64/debug windows
#kernel
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lkernel
#kernel_network

View File

@ -2,7 +2,8 @@
#define CHECK_URL L"http://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/updates/editors_update_x64.exe"
typedef NSNetwork::NSFileTransport::CFileDownloader Downloader;
#include <vector>
int wmain(int argc, wchar_t *argv[])
//int wmain(int argc, wchar_t *argv[]) windows
int main(int argc, char *argv[])
{
auto check_url = CHECK_URL;
auto downloader = new Downloader(check_url, false);
@ -10,6 +11,7 @@ int wmain(int argc, wchar_t *argv[])
downloader->SetEvent_OnProgress([&](int percent) {
vec.push_back(percent);
});
downloader->SetFilePath(L"C:\\Users\\Vladimir.Gorshenkov\\Downloads\\tmp.exe");
downloader->SetFilePath(L"/mnt/HDD_DATA/Work/core/Test/Applications/TestDownloader/tmp.exe");
//downloader->SetFilePath(L"C:\\Users\\Vladimir.Gorshenkov\\Downloads\\tmp.exe"); windows
downloader->DownloadSync();
}