4 Commits

Author SHA1 Message Date
Tixx
dff2f2712b Bump version 2024-11-07 22:12:20 +01:00
Lion
3effe0d4de log zlib error message and regex fix (#146) 2024-11-07 22:05:40 +01:00
Tixx
d58ff960ec Fix github regex 2024-11-07 21:39:18 +01:00
Tixx
f67f8573e0 Log zlib error messages 2024-11-07 21:36:38 +01:00
3 changed files with 4 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ std::vector<char> Comp(std::span<const char> input) {
reinterpret_cast<const Bytef*>(input.data()), reinterpret_cast<const Bytef*>(input.data()),
static_cast<uLongf>(input.size())); static_cast<uLongf>(input.size()));
if (res != Z_OK) { if (res != Z_OK) {
error("zlib compress() failed: " + std::to_string(res)); error("zlib compress() failed (code: " + std::to_string(res) + ", message: " + zError(res) + ")");
throw std::runtime_error("zlib compress() failed"); throw std::runtime_error("zlib compress() failed");
} }
debug("zlib compressed " + std::to_string(input.size()) + " B to " + std::to_string(output_size) + " B"); debug("zlib compressed " + std::to_string(input.size()) + " B to " + std::to_string(output_size) + " B");
@@ -52,7 +52,7 @@ std::vector<char> DeComp(std::span<const char> input) {
output_buffer.resize(output_buffer.size() * 2); output_buffer.resize(output_buffer.size() * 2);
output_size = output_buffer.size(); output_size = output_buffer.size();
} else if (res != Z_OK) { } else if (res != Z_OK) {
error("zlib uncompress() failed: " + std::to_string(res)); error("zlib uncompress() failed (code: " + std::to_string(res) + ", message: " + zError(res) + ")");
throw std::runtime_error("zlib uncompress() failed"); throw std::runtime_error("zlib uncompress() failed");
} else if (res == Z_OK) { } else if (res == Z_OK) {
break; break;

View File

@@ -104,7 +104,7 @@ void CoreSend(std::string data) {
} }
bool IsAllowedLink(const std::string& Link) { bool IsAllowedLink(const std::string& Link) {
std::regex link_pattern(R"(https:\/\/(?:\w+)?(?:\.)?(?:beammp\.com|beammp\.gg|github.com\/BeamMP\/|discord\.gg|patreon\.com\/BeamMP))"); std::regex link_pattern(R"(https:\/\/(?:\w+)?(?:\.)?(?:beammp\.com|beammp\.gg|github\.com\/BeamMP\/|discord\.gg|patreon\.com\/BeamMP))");
std::smatch link_match; std::smatch link_match;
return std::regex_search(Link, link_match, link_pattern) && link_match.position() == 0; return std::regex_search(Link, link_match, link_pattern) && link_match.position() == 0;
} }

View File

@@ -85,7 +85,7 @@ std::string GetVer() {
return "2.3"; return "2.3";
} }
std::string GetPatch() { std::string GetPatch() {
return ".1"; return ".2";
} }
std::string GetEP(const char* P) { std::string GetEP(const char* P) {