mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
LibCore: Put HTTP debug spam behind FOO_DEBUG macros
This commit is contained in:
parent
36bb03b6dd
commit
43a9843938
2 changed files with 12 additions and 0 deletions
|
@ -4,6 +4,8 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define CHTTPJOB_DEBUG
|
||||
|
||||
CHttpJob::CHttpJob(const CHttpRequest& request)
|
||||
: m_request(request)
|
||||
{
|
||||
|
@ -75,7 +77,9 @@ void CHttpJob::on_socket_connected()
|
|||
}
|
||||
auto value = chomped_line.substring(name.length() + 2, chomped_line.length() - name.length() - 2);
|
||||
m_headers.set(name, value);
|
||||
#ifdef CHTTPJOB_DEBUG
|
||||
dbg() << "CHttpJob: [" << name << "] = '" << value << "'";
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
ASSERT(m_state == State::InBody);
|
||||
|
@ -120,7 +124,9 @@ void CHttpJob::start()
|
|||
ASSERT(!m_socket);
|
||||
m_socket = CTCPSocket::construct(this);
|
||||
m_socket->on_connected = [this] {
|
||||
#ifdef CHTTPJOB_DEBUG
|
||||
dbg() << "CHttpJob: on_connected callback";
|
||||
#endif
|
||||
on_socket_connected();
|
||||
};
|
||||
bool success = m_socket->connect(m_request.url().host(), m_request.url().port());
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include <LibCore/CNetworkResponse.h>
|
||||
#include <stdio.h>
|
||||
|
||||
//#define CNETWORKJOB_DEBUG
|
||||
|
||||
CNetworkJob::CNetworkJob()
|
||||
{
|
||||
}
|
||||
|
@ -13,7 +15,9 @@ CNetworkJob::~CNetworkJob()
|
|||
void CNetworkJob::did_finish(NonnullRefPtr<CNetworkResponse>&& response)
|
||||
{
|
||||
m_response = move(response);
|
||||
#ifdef CNETWORKJOB_DEBUG
|
||||
dbg() << *this << " job did_finish!";
|
||||
#endif
|
||||
ASSERT(on_finish);
|
||||
on_finish(true);
|
||||
shutdown();
|
||||
|
@ -22,7 +26,9 @@ void CNetworkJob::did_finish(NonnullRefPtr<CNetworkResponse>&& response)
|
|||
void CNetworkJob::did_fail(Error error)
|
||||
{
|
||||
m_error = error;
|
||||
#ifdef CNETWORKJOB_DEBUG
|
||||
dbgprintf("%s{%p} job did_fail! error: %u (%s)\n", class_name(), this, (unsigned)error, to_string(error));
|
||||
#endif
|
||||
ASSERT(on_finish);
|
||||
on_finish(false);
|
||||
shutdown();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue