Base128 encoding of minidumps before uploading.
This commit is contained in:
@ -279,6 +279,11 @@ namespace Components
|
||||
|
||||
std::string compressedMinidump = Utils::Compression::ZLib::Compress(minidump->ToString());
|
||||
|
||||
#ifndef DISABLE_BASE128
|
||||
extraHeaders["Encoding"] = "base128";
|
||||
compressedMinidump = Utils::String::EncodeBase128(compressedMinidump);
|
||||
#endif
|
||||
|
||||
Logger::Print("Uploading minidump...\n");
|
||||
|
||||
#ifdef DISABLE_BITMESSAGE
|
||||
@ -345,7 +350,8 @@ namespace Components
|
||||
std::string marker = "MINIDUMP";
|
||||
std::stringstream output;
|
||||
|
||||
extraHeaders["Encoding"] = "raw";
|
||||
if (extraHeaders.find("Encoding") == extraHeaders.end())
|
||||
extraHeaders["Encoding"] = "raw";
|
||||
extraHeaders["Version"] = VERSION_STR;
|
||||
|
||||
output << "-----BEGIN " << marker << "-----\n";
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "STDInclude.hpp"
|
||||
#include "base128.h"
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
@ -131,6 +132,14 @@ namespace Utils
|
||||
return EncodeBase64(input.c_str(), input.size());
|
||||
}
|
||||
|
||||
// Encodes a given string in Base128
|
||||
std::string EncodeBase128(const std::string& input) {
|
||||
auto encoder = new base128();
|
||||
auto buffer = encoder->encode(const_cast<void*>(static_cast<const void*>(input.data())), input.size());
|
||||
delete encoder;
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
// Generates a UUID and returns the string representation of it
|
||||
std::string GenerateUUIDString() {
|
||||
// Generate UUID data
|
||||
|
@ -43,6 +43,8 @@ namespace Utils
|
||||
std::string EncodeBase64(const char* input, const unsigned long inputSize);
|
||||
std::string EncodeBase64(const std::string& input);
|
||||
|
||||
std::string EncodeBase128(const std::string& input);
|
||||
|
||||
std::string GenerateUUIDString();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user