Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » how to open Trace in U++ core?
how to open Trace in U++ core? [message #48539] Wed, 19 July 2017 08:05 Go to next message
akebee is currently offline  akebee
Messages: 88
Registered: August 2011
Location: China
Member
i want to debug HttpRequest, go into Http.cpp:

namespace Ini {
	INI_BOOL(HttpRequest_Trace, false, "Activates HTTP requests tracing")
	INI_BOOL(HttpRequest_TraceBody, false, "Activates HTTP requests body tracing")
	INI_BOOL(HttpRequest_TraceShort, false, "Activates HTTP requests short tracing")
};

#define LLOG(x)      LOG_(Ini::HttpRequest_Trace, x)


how to open HttpRequest_Trace? create somename.ini and set
HttpRequest_Trace=true

it donesn't work?
Re: how to open Trace in U++ core? [message #48540 is a reply to message #48539] Wed, 19 July 2017 08:49 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 574
Registered: August 2007
Location: Turkey
Contributor
Hello akebee,

HttpRequest::Trace(); // Simply invoke this method. 


In Inet.h, you can see that HttpRequest has several static trace methods with different levels of debug information:

	static void  Trace(bool b = true);
	static void  TraceHeader(bool b = true);
	static void  TraceBody(bool b = true);
        static void  TraceShort(bool b = true);


Best regards,
Oblivion


[Updated on: Wed, 19 July 2017 08:50]

Report message to a moderator

Re: how to open Trace in U++ core? [message #48541 is a reply to message #48540] Wed, 19 July 2017 11:14 Go to previous messageGo to next message
akebee is currently offline  akebee
Messages: 88
Registered: August 2011
Location: China
Member
thank you very much ! i`m trying to find out why HttpRequest blocked and TimeOut(ms) did not work at all
Re: how to open Trace in U++ core? [message #48542 is a reply to message #48541] Wed, 19 July 2017 11:40 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 574
Registered: August 2007
Location: Turkey
Contributor
Hello akebee,

It is better not to directly call TcpSocket::Timeout() while using HttpRequest (because HttpRequest class is inherently asynchronous, using TcpSocket::Timeout() may lead to erratic behaviour.).
Did you try the below timeout setter?

HttpRequest::RequestTimeout()


Best regards,
Oblivion


[Updated on: Wed, 19 July 2017 11:41]

Report message to a moderator

Re: how to open Trace in U++ core? [message #48543 is a reply to message #48542] Thu, 20 July 2017 04:04 Go to previous message
akebee is currently offline  akebee
Messages: 88
Registered: August 2011
Location: China
Member
yeh HttpRequest::RequestTimeout() worked! tks

i'm annoying for a long time the HttpRequest::Execute() blocked occasional ,it blocked even more than hours!
RequestTimeout saved me Laughing
but i found Timeout() in bazaar\Updater\updater.cpp

		http.Timeout(1000);
		http.Url(GetPlatformRoot() + "versions");
		http.WhenDo.Clear();

[Updated on: Thu, 20 July 2017 04:09]

Report message to a moderator

Previous Topic: Sys command truncates captured console output
Next Topic: Is there a U++ function to copy a String contents to the clipboard
Goto Forum:
  


Current Time: Sun Aug 25 22:23:28 CEST 2019

Total time taken to generate the page: 0.00992 seconds