Core: HttpRequest can disable logging of body separately, umk: POSIX setlinbuf

git-svn-id: svn://ultimatepp.org/upp/trunk@6319 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-09-06 12:51:40 +00:00
parent 4ab8390cdd
commit 920e9f26fa
2 changed files with 8 additions and 1 deletions

View file

@ -4,9 +4,11 @@ NAMESPACE_UPP
namespace Ini {
INI_BOOL(HttpRequest_Trace, false, "Activates HTTP requests tracing")
INI_BOOL(HttpRequest_TraceBody, false, "Activates HTTP requests body tracing")
};
#define LLOG(x) LOG_(Ini::HttpRequest_Trace, x)
#define LLOGB(x) LOG_(Ini::HttpRequest_TraceBody, x)
#ifdef _DEBUG
_DBG_
@ -16,6 +18,7 @@ _DBG_
void HttpRequest::Trace(bool b)
{
Ini::HttpRequest_Trace = b;
Ini::HttpRequest_TraceBody = b;
}
void HttpRequest::Init()
@ -543,9 +546,10 @@ void HttpRequest::StartRequest()
if(!force_digest && (!IsNull(username) || !IsNull(password)))
data << "Authorization: Basic " << Base64Encode(username + ":" + password) << "\r\n";
data << request_headers;
data << "\r\n" << pd;
LLOG("HTTP REQUEST " << host << ":" << port);
LLOG("HTTP request:\n" << data);
data << "\r\n" << pd;
LLOGB("HTTP request body:\n" << pd);
}
bool HttpRequest::SendingData()

View file

@ -49,6 +49,9 @@ int IsCommaOrColon(int c)
CONSOLE_APP_MAIN
{
#ifdef PLATFORM_POSIX
setlinebuf(stdout);
#endif
Ide ide;
TheIde(&ide);
ide.console.SetSlots(CPU_Cores());