Skip to content

Commit

Permalink
removed the uncessary lines from fileTransferService.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
tajiknomi committed Sep 3, 2024
1 parent 5dab401 commit 2089a60
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions curlFileTransfer/src/fileTransferService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ size_t curlFileTransfer::WriteCallback(void* contents, size_t size, size_t nmemb

bool curlFileTransfer::isDataServerAvailable(const std::string& url) {

// ORDINAL values are used
//CurlEasyInitFunc curl_easy_init = (CurlEasyInitFunc)(GetProcAddress(hCurlLib, "curl_easy_init"));
//CurlEasyCleanupFunc curl_easy_cleanup = (CurlEasyCleanupFunc)(GetProcAddress(hCurlLib, "curl_easy_cleanup"));
//CurlEasySetoptFunc curl_easy_setopt = (CurlEasySetoptFunc)(GetProcAddress(hCurlLib, "curl_easy_setopt"));
//CurlEasyPerformFunc curl_easy_perform = (CurlEasyPerformFunc)(GetProcAddress(hCurlLib, "curl_easy_perform"));
//CurlEasyGetinfoFunc curl_easy_getinfo = (CurlEasyGetinfoFunc)(GetProcAddress(hCurlLib, MAKEINTRESOURCEA(4)));
//if (!curl_easy_init || !curl_easy_cleanup || !curl_easy_setopt || !curl_easy_perform || !curl_easy_getinfo) {
// return false;
//}

CURL* curl = curl_easy_init();
if (!curl) {
// std::cerr << "Curl initialization failed." << std::endl;
Expand Down Expand Up @@ -79,16 +69,6 @@ bool curlFileTransfer::isDataServerAvailable(const std::string& url) {

bool curlFileTransfer::DownloadFileFromURL(const std::wstring &url, const std::wstring &destDirPath, std::wstring &errorMsg) {

//CurlEasyInitFunc curl_easy_init = (CurlEasyInitFunc)(GetProcAddress(hCurlLib, "curl_easy_init"));
//CurlEasyCleanupFunc curl_easy_cleanup = (CurlEasyCleanupFunc)(GetProcAddress(hCurlLib, "curl_easy_cleanup"));
//CurlEasySetoptFunc curl_easy_setopt = (CurlEasySetoptFunc)(GetProcAddress(hCurlLib, "curl_easy_setopt"));
//CurlEasyPerformFunc curl_easy_perform = (CurlEasyPerformFunc)(GetProcAddress(hCurlLib, "curl_easy_perform"));
//CurlEasyStrerrorFunc curl_easy_strerror = (CurlEasyStrerrorFunc)(GetProcAddress(hCurlLib, "curl_easy_strerror"));
//if (!curl_easy_init || !curl_easy_cleanup || !curl_easy_setopt || !curl_easy_perform || !curl_easy_strerror) {
// errorMsg = L"Failed to get function pointers from libcurl.dll";
// return false;
//}

CURL* curl = curl_easy_init();
if (!curl) {
errorMsg = L"Failed to initialize libcurl";
Expand Down Expand Up @@ -138,19 +118,6 @@ bool curlFileTransfer::UploadFileToURL(const std::wstring &url, const std::wstri
std::wstring filename = extractFilename(filePath);
std::string filenameUtf8 = StringUtils::convertWStringToUTF8(filename);


//CurlEasyInitFunc curl_easy_init = (CurlEasyInitFunc)(GetProcAddress(hCurlLib, "curl_easy_init"));
//CurlEasyCleanupFunc curl_easy_cleanup = (CurlEasyCleanupFunc)(GetProcAddress(hCurlLib, "curl_easy_cleanup"));
//CurlEasySetoptFunc curl_easy_setopt = (CurlEasySetoptFunc)(GetProcAddress(hCurlLib, "curl_easy_setopt"));
//CurlEasyPerformFunc curl_easy_perform = (CurlEasyPerformFunc)(GetProcAddress(hCurlLib, "curl_easy_perform"));
//CurlEasyStrerrorFunc curl_easy_strerror = (CurlEasyStrerrorFunc)(GetProcAddress(hCurlLib, "curl_easy_strerror"));
//CurlFormFreeFunc curl_formfree = (CurlFormFreeFunc)(GetProcAddress(hCurlLib, "curl_formfree"));
//CurlFormAddFunc curl_formadd = (CurlFormAddFunc)(GetProcAddress(hCurlLib, "curl_formadd"));

//if (!curl_easy_init || !curl_easy_cleanup || !curl_easy_setopt || !curl_easy_perform || !curl_easy_strerror || !curl_formfree || !curl_formadd) {
// errorMsg = L"Failed to get function pointers from libcurl.dll";
// return false;
//}
CURL* curl = curl_easy_init();
if (!curl) {
errorMsg = L"Failed to initialize libcurl";
Expand Down

0 comments on commit 2089a60

Please sign in to comment.