From 78b433bac8226c39eb9b4aa099d7a713ddef4485 Mon Sep 17 00:00:00 2001 From: cx9ps3 Date: Sat, 13 Nov 2021 02:50:34 +0200 Subject: [PATCH 1/3] fixed invalid conversion from int to MHD_Result in method start_daemon --- xmrstak/http/httpd.cpp | 24 ++++++++++++------------ xmrstak/http/httpd.hpp | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/xmrstak/http/httpd.cpp b/xmrstak/http/httpd.cpp index b4f0f547e..99aa01a70 100644 --- a/xmrstak/http/httpd.cpp +++ b/xmrstak/http/httpd.cpp @@ -35,7 +35,7 @@ #include #include -#include + #ifdef _WIN32 #define strcasecmp _stricmp #endif // _WIN32 @@ -46,7 +46,7 @@ httpd::httpd() { } -int httpd::req_handler(void* cls, +MHD_Result httpd::req_handler(void* cls, MHD_Connection* connection, const char* url, const char* method, @@ -63,25 +63,25 @@ int httpd::req_handler(void* cls, if(strlen(jconf::inst()->GetHttpUsername()) != 0) { char* username; - int ret; + MHD_Result result; username = MHD_digest_auth_get_username(connection); if(username == NULL) { rsp = MHD_create_response_from_buffer(sHtmlAccessDeniedSize, (void*)sHtmlAccessDenied, MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_auth_fail_response(connection, sHttpAuthRealm, sHttpAuthOpaque, rsp, MHD_NO); + result = MHD_queue_auth_fail_response(connection, sHttpAuthRealm, sHttpAuthOpaque, rsp, MHD_NO); MHD_destroy_response(rsp); - return ret; + return result; } free(username); - ret = MHD_digest_auth_check(connection, sHttpAuthRealm, jconf::inst()->GetHttpUsername(), jconf::inst()->GetHttpPassword(), 300); - if(ret == MHD_INVALID_NONCE || ret == MHD_NO) + int ret = MHD_digest_auth_check(connection, sHttpAuthRealm, jconf::inst()->GetHttpUsername(), jconf::inst()->GetHttpPassword(), 300); + if(ret == MHD_INVALID_NONCE || result == MHD_NO) { rsp = MHD_create_response_from_buffer(sHtmlAccessDeniedSize, (void*)sHtmlAccessDenied, MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_auth_fail_response(connection, sHttpAuthRealm, sHttpAuthOpaque, rsp, (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); + result = MHD_queue_auth_fail_response(connection, sHttpAuthRealm, sHttpAuthOpaque, rsp, (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); MHD_destroy_response(rsp); - return ret; + return result; } } @@ -95,7 +95,7 @@ int httpd::req_handler(void* cls, { //Cache hit rsp = MHD_create_response_from_buffer(0, nullptr, MHD_RESPMEM_PERSISTENT); - int ret = MHD_queue_response(connection, MHD_HTTP_NOT_MODIFIED, rsp); + MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_NOT_MODIFIED, rsp); MHD_destroy_response(rsp); return ret; } @@ -144,13 +144,13 @@ int httpd::req_handler(void* cls, snprintf(loc_path, sizeof(loc_path), "/h"); rsp = MHD_create_response_from_buffer(0, nullptr, MHD_RESPMEM_PERSISTENT); - int ret = MHD_queue_response(connection, MHD_HTTP_TEMPORARY_REDIRECT, rsp); + MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_TEMPORARY_REDIRECT, rsp); MHD_add_response_header(rsp, "Location", loc_path); MHD_destroy_response(rsp); return ret; } - int ret = MHD_queue_response(connection, MHD_HTTP_OK, rsp); + MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_OK, rsp); MHD_destroy_response(rsp); return ret; } diff --git a/xmrstak/http/httpd.hpp b/xmrstak/http/httpd.hpp index dfad082ca..eefbd5874 100644 --- a/xmrstak/http/httpd.hpp +++ b/xmrstak/http/httpd.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include struct MHD_Daemon; struct MHD_Connection; @@ -21,7 +22,7 @@ class httpd httpd(); static httpd* oInst; - static int req_handler(void* cls, + static MHD_Result req_handler(void* cls, MHD_Connection* connection, const char* url, const char* method, From 8adb208987f5881946992ab9cd9a45e4e2a4b870 Mon Sep 17 00:00:00 2001 From: cx9ps3 Date: Sat, 13 Nov 2021 03:30:58 +0200 Subject: [PATCH 2/3] fixed complile issues with new versions of libmicrohttpd --- CMakeLists.txt.user | 323 +++++++++++++++++++++++++++++++++++++++++ xmrstak/http/httpd.cpp | 10 +- xmrstak/http/httpd.hpp | 11 +- 3 files changed, 338 insertions(+), 6 deletions(-) create mode 100644 CMakeLists.txt.user diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 index 000000000..46ad4be03 --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,323 @@ + + + + + + EnvironmentId + {bccbca4b-2835-4ae4-a253-4621a15ac4b3} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + Builtin.BuildSystem + + true + true + Builtin.DefaultTidyAndClazy + 8 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 5.15.2 GCC 64bit + Desktop Qt 5.15.2 GCC 64bit + qt.qt5.5152.gcc_64_kit + 0 + 0 + 0 + + Debug + -GNinja +-DCUDA_ENABLE=OFF +-DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-Debug + + + + all + + true + Build + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + Build + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + Release + -GNinja +-DCMAKE_BUILD_TYPE:STRING=Release +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-Release + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + RelWithDebInfo + -GNinja +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-RelWithDebInfo + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + MinSizeRel + -GNinja +-DCMAKE_BUILD_TYPE:STRING=MinSizeRel +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-MinSizeRel + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + xmr-stak + CMakeProjectManager.CMakeRunConfiguration.xmr-stak + xmr-stak + false + true + true + false + true + /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-Debug/bin + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/xmrstak/http/httpd.cpp b/xmrstak/http/httpd.cpp index 99aa01a70..dfa4313cc 100644 --- a/xmrstak/http/httpd.cpp +++ b/xmrstak/http/httpd.cpp @@ -46,7 +46,7 @@ httpd::httpd() { } -MHD_Result httpd::req_handler(void* cls, +MHD_RESULT httpd::req_handler(void* cls, MHD_Connection* connection, const char* url, const char* method, @@ -63,7 +63,7 @@ MHD_Result httpd::req_handler(void* cls, if(strlen(jconf::inst()->GetHttpUsername()) != 0) { char* username; - MHD_Result result; + MHD_RESULT result; username = MHD_digest_auth_get_username(connection); if(username == NULL) @@ -95,7 +95,7 @@ MHD_Result httpd::req_handler(void* cls, { //Cache hit rsp = MHD_create_response_from_buffer(0, nullptr, MHD_RESPMEM_PERSISTENT); - MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_NOT_MODIFIED, rsp); + MHD_RESULT ret = MHD_queue_response(connection, MHD_HTTP_NOT_MODIFIED, rsp); MHD_destroy_response(rsp); return ret; } @@ -144,13 +144,13 @@ MHD_Result httpd::req_handler(void* cls, snprintf(loc_path, sizeof(loc_path), "/h"); rsp = MHD_create_response_from_buffer(0, nullptr, MHD_RESPMEM_PERSISTENT); - MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_TEMPORARY_REDIRECT, rsp); + MHD_RESULT ret = MHD_queue_response(connection, MHD_HTTP_TEMPORARY_REDIRECT, rsp); MHD_add_response_header(rsp, "Location", loc_path); MHD_destroy_response(rsp); return ret; } - MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_OK, rsp); + MHD_RESULT ret = MHD_queue_response(connection, MHD_HTTP_OK, rsp); MHD_destroy_response(rsp); return ret; } diff --git a/xmrstak/http/httpd.hpp b/xmrstak/http/httpd.hpp index eefbd5874..387437906 100644 --- a/xmrstak/http/httpd.hpp +++ b/xmrstak/http/httpd.hpp @@ -2,6 +2,15 @@ #include #include +#if MHD_VERSION >= 0x00097002 + +#define MHD_RESULT enum MHD_Result + +#else + +#define MHD_RESULT int + +#endif struct MHD_Daemon; struct MHD_Connection; @@ -22,7 +31,7 @@ class httpd httpd(); static httpd* oInst; - static MHD_Result req_handler(void* cls, + static MHD_RESULT req_handler(void* cls, MHD_Connection* connection, const char* url, const char* method, From 7753f95bebb496b1109a03afd4064528e5020360 Mon Sep 17 00:00:00 2001 From: l09dm0zgus <43546162+l09dm0zgus@users.noreply.github.com> Date: Sat, 13 Nov 2021 00:34:23 +0200 Subject: [PATCH 3/3] Delete CMakeLists.txt.user --- CMakeLists.txt.user | 323 -------------------------------------------- 1 file changed, 323 deletions(-) delete mode 100644 CMakeLists.txt.user diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user deleted file mode 100644 index 46ad4be03..000000000 --- a/CMakeLists.txt.user +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - EnvironmentId - {bccbca4b-2835-4ae4-a253-4621a15ac4b3} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - false - true - false - 0 - true - true - 0 - 8 - true - false - 1 - true - true - true - *.md, *.MD, Makefile - false - true - - - - ProjectExplorer.Project.PluginSettings - - - true - false - true - true - true - true - - - 0 - true - - true - Builtin.BuildSystem - - true - true - Builtin.DefaultTidyAndClazy - 8 - - - - true - - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop Qt 5.15.2 GCC 64bit - Desktop Qt 5.15.2 GCC 64bit - qt.qt5.5152.gcc_64_kit - 0 - 0 - 0 - - Debug - -GNinja --DCUDA_ENABLE=OFF --DCMAKE_BUILD_TYPE:STRING=Debug --DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} - /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-Debug - - - - all - - true - Build - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - Build - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Debug - CMakeProjectManager.CMakeBuildConfiguration - - - Release - -GNinja --DCMAKE_BUILD_TYPE:STRING=Release --DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} - /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-Release - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Release - CMakeProjectManager.CMakeBuildConfiguration - - - RelWithDebInfo - -GNinja --DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo --DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} - /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-RelWithDebInfo - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Release with Debug Information - CMakeProjectManager.CMakeBuildConfiguration - - - MinSizeRel - -GNinja --DCMAKE_BUILD_TYPE:STRING=MinSizeRel --DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} - /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-MinSizeRel - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Minimum Size Release - CMakeProjectManager.CMakeBuildConfiguration - - 4 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - true - true - true - - 2 - - xmr-stak - CMakeProjectManager.CMakeRunConfiguration.xmr-stak - xmr-stak - false - true - true - false - true - /home/cx9ps3/build-xmr-stak-Desktop_Qt_5_15_2_GCC_64bit-Debug/bin - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - -