File transfer server now respects the port and host settings set via the config.yml

This commit is contained in:
WolverinDEV 2020-06-13 01:08:46 +02:00
parent 32dc9423c2
commit d772aa050c

View File

@ -9,7 +9,11 @@
#define TRACK_OBJECT_ALLOCATION #define TRACK_OBJECT_ALLOCATION
#include "memtracker.h" #include "memtracker.h"
#define NO_IMPL //For fast disable (e.g. when you dont want to recompile the whole source) #ifdef NDEBUG
#define NO_IMPL //For fast disable (e.g. when you dont want to recompile the whole source)
#else
#define NO_IMPL
#endif
#ifndef __GLIBC__ #ifndef __GLIBC__
#define _GLIBCXX_NOEXCEPT #define _GLIBCXX_NOEXCEPT
@ -65,6 +69,8 @@ namespace memtrack {
: strcmp (name, __arg.name) < 0; } : strcmp (name, __arg.name) < 0; }
inline std::string as_mangled() { inline std::string as_mangled() {
if(!this->mangled.empty())
return this->mangled;
#ifndef WIN32 #ifndef WIN32
int status; int status;
std::unique_ptr<char[], void (*)(void*)> result(abi::__cxa_demangle(name, nullptr, nullptr, &status), std::free); std::unique_ptr<char[], void (*)(void*)> result(abi::__cxa_demangle(name, nullptr, nullptr, &status), std::free);
@ -82,12 +88,12 @@ namespace memtrack {
class entry { class entry {
public: public:
/* std::string name; */ /* std::string name; */
size_t type; size_t type{};
void* address = nullptr; void* address = nullptr;
entry() {} entry() = default;
entry(size_t type, void* address) : type(type), address(address) {} entry(size_t type, void* address) : type(type), address(address) {}
~entry() {} ~entry() = default;
}; };
template <int N> template <int N>
@ -178,7 +184,7 @@ namespace memtrack {
auto _value = (size_t) type_index.value; auto _value = (size_t) type_index.value;
for (auto &brick : bricks) for (auto &brick : bricks)
if(brick->remove(_value, address)) return; if(brick->remove(_value, address)) return;
logError(lstream << "[MEMORY] Got deallocated notify, but never the allocated! (Address: " << address << " Name: " << name << ")"); logError(LOG_GENERAL, "[MEMORY] Got deallocated notify, but never the allocated! (Address: {} Name: {})", address, name);
#endif #endif
} }
@ -201,25 +207,25 @@ namespace memtrack {
mapping[type.second.value] = type.first.as_mangled(); mapping[type.second.value] = type.first.as_mangled();
} }
logMessage("Allocated object types: " + to_string(objects.size())); logMessage(LOG_GENERAL, "Allocated object types: " + to_string(objects.size()));
for(const auto& entry : objects) { for(const auto& entry : objects) {
logMessage(" " + mapping[entry.first] + ": " + to_string(entry.second.size())); logMessage(LOG_GENERAL, " " + mapping[entry.first] + ": " + to_string(entry.second.size()));
if (entry.second.size() < 50) { if (entry.second.size() < 50) {
stringstream ss; stringstream ss;
for (int index = 0; index < entry.second.size(); index++) { for (int index = 0; index < entry.second.size(); index++) {
if (index % 16 == 0) { if (index % 16 == 0) {
if (index + 1 >= entry.second.size()) break; if (index + 1 >= entry.second.size()) break;
if (index != 0) if (index != 0)
logMessage(ss.str()); logMessage(LOG_GENERAL, ss.str());
ss = stringstream(); ss = stringstream();
ss << " "; ss << " ";
} }
ss << entry.second[index] << " "; ss << entry.second[index] << " ";
} }
if (!ss.str().empty()) if (!ss.str().empty())
logMessage(ss.str()); logMessage(LOG_GENERAL, ss.str());
} else { } else {
logMessage("<snipped>"); logMessage(LOG_GENERAL, "<snipped>");
} }
} }
#endif #endif