@@ -42,16 +42,6 @@ size_t curlFileTransfer::WriteCallback(void* contents, size_t size, size_t nmemb
42
42
43
43
bool curlFileTransfer::isDataServerAvailable (const std::string& url) {
44
44
45
- // ORDINAL values are used
46
- // CurlEasyInitFunc curl_easy_init = (CurlEasyInitFunc)(GetProcAddress(hCurlLib, "curl_easy_init"));
47
- // CurlEasyCleanupFunc curl_easy_cleanup = (CurlEasyCleanupFunc)(GetProcAddress(hCurlLib, "curl_easy_cleanup"));
48
- // CurlEasySetoptFunc curl_easy_setopt = (CurlEasySetoptFunc)(GetProcAddress(hCurlLib, "curl_easy_setopt"));
49
- // CurlEasyPerformFunc curl_easy_perform = (CurlEasyPerformFunc)(GetProcAddress(hCurlLib, "curl_easy_perform"));
50
- // CurlEasyGetinfoFunc curl_easy_getinfo = (CurlEasyGetinfoFunc)(GetProcAddress(hCurlLib, MAKEINTRESOURCEA(4)));
51
- // if (!curl_easy_init || !curl_easy_cleanup || !curl_easy_setopt || !curl_easy_perform || !curl_easy_getinfo) {
52
- // return false;
53
- // }
54
-
55
45
CURL* curl = curl_easy_init ();
56
46
if (!curl) {
57
47
// std::cerr << "Curl initialization failed." << std::endl;
@@ -79,16 +69,6 @@ bool curlFileTransfer::isDataServerAvailable(const std::string& url) {
79
69
80
70
bool curlFileTransfer::DownloadFileFromURL (const std::wstring &url, const std::wstring &destDirPath, std::wstring &errorMsg) {
81
71
82
- // CurlEasyInitFunc curl_easy_init = (CurlEasyInitFunc)(GetProcAddress(hCurlLib, "curl_easy_init"));
83
- // CurlEasyCleanupFunc curl_easy_cleanup = (CurlEasyCleanupFunc)(GetProcAddress(hCurlLib, "curl_easy_cleanup"));
84
- // CurlEasySetoptFunc curl_easy_setopt = (CurlEasySetoptFunc)(GetProcAddress(hCurlLib, "curl_easy_setopt"));
85
- // CurlEasyPerformFunc curl_easy_perform = (CurlEasyPerformFunc)(GetProcAddress(hCurlLib, "curl_easy_perform"));
86
- // CurlEasyStrerrorFunc curl_easy_strerror = (CurlEasyStrerrorFunc)(GetProcAddress(hCurlLib, "curl_easy_strerror"));
87
- // if (!curl_easy_init || !curl_easy_cleanup || !curl_easy_setopt || !curl_easy_perform || !curl_easy_strerror) {
88
- // errorMsg = L"Failed to get function pointers from libcurl.dll";
89
- // return false;
90
- // }
91
-
92
72
CURL* curl = curl_easy_init ();
93
73
if (!curl) {
94
74
errorMsg = L" Failed to initialize libcurl" ;
@@ -138,19 +118,6 @@ bool curlFileTransfer::UploadFileToURL(const std::wstring &url, const std::wstri
138
118
std::wstring filename = extractFilename (filePath);
139
119
std::string filenameUtf8 = StringUtils::convertWStringToUTF8 (filename);
140
120
141
-
142
- // CurlEasyInitFunc curl_easy_init = (CurlEasyInitFunc)(GetProcAddress(hCurlLib, "curl_easy_init"));
143
- // CurlEasyCleanupFunc curl_easy_cleanup = (CurlEasyCleanupFunc)(GetProcAddress(hCurlLib, "curl_easy_cleanup"));
144
- // CurlEasySetoptFunc curl_easy_setopt = (CurlEasySetoptFunc)(GetProcAddress(hCurlLib, "curl_easy_setopt"));
145
- // CurlEasyPerformFunc curl_easy_perform = (CurlEasyPerformFunc)(GetProcAddress(hCurlLib, "curl_easy_perform"));
146
- // CurlEasyStrerrorFunc curl_easy_strerror = (CurlEasyStrerrorFunc)(GetProcAddress(hCurlLib, "curl_easy_strerror"));
147
- // CurlFormFreeFunc curl_formfree = (CurlFormFreeFunc)(GetProcAddress(hCurlLib, "curl_formfree"));
148
- // CurlFormAddFunc curl_formadd = (CurlFormAddFunc)(GetProcAddress(hCurlLib, "curl_formadd"));
149
-
150
- // if (!curl_easy_init || !curl_easy_cleanup || !curl_easy_setopt || !curl_easy_perform || !curl_easy_strerror || !curl_formfree || !curl_formadd) {
151
- // errorMsg = L"Failed to get function pointers from libcurl.dll";
152
- // return false;
153
- // }
154
121
CURL* curl = curl_easy_init ();
155
122
if (!curl) {
156
123
errorMsg = L" Failed to initialize libcurl" ;
0 commit comments