1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00

LibCore: Silence some aggressive CSocket and CHttpJob debug spam

This commit is contained in:
Andreas Kling 2019-12-14 11:30:18 +01:00
parent ac215ca601
commit 6b71250d1a
2 changed files with 19 additions and 2 deletions

View file

@ -5,19 +5,22 @@
#include <stdio.h>
#include <unistd.h>
#define CHTTPJOB_DEBUG
//#define CHTTPJOB_DEBUG
static ByteBuffer handle_content_encoding(const ByteBuffer& buf, const String& content_encoding)
{
#ifdef CHTTPJOB_DEBUG
dbg() << "CHttpJob::handle_content_encoding: buf has content_encoding = " << content_encoding;
#endif
if (content_encoding == "gzip") {
if (!CGzip::is_compressed(buf)) {
dbg() << "CHttpJob::handle_content_encoding: buf is not gzip compressed!";
}
#ifdef CHTTPJOB_DEBUG
dbg() << "CHttpJob::handle_content_encoding: buf is gzip compressed!";
#endif
auto uncompressed = CGzip::decompress(buf);
if (!uncompressed.has_value()) {
@ -25,9 +28,11 @@ static ByteBuffer handle_content_encoding(const ByteBuffer& buf, const String& c
return buf;
}
#ifdef CHTTPJOB_DEBUG
dbg() << "CHttpJob::handle_content_encoding: Gzip::decompress() successful.\n"
<< " Input size = " << buf.size() << "\n"
<< " Output size = " << uncompressed.value().size();
#endif
return uncompressed.value();
}