mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
Multiple improvements in debugging helpers
Add variadic style macro helpers that make debugging code disappear completely (also the paramethers evaluation) when debugging level is lower Chained style << is now atomic like variadic style, still can't benefit of paramethers eveluation stripping Reduced to minimum the difference between Android and other platform debugging code Port debugging code to new helpers, expecially a few corner cases to test it, and as examples of how to use it.
This commit is contained in:
parent
5f06651e54
commit
aef87fb1f8
11 changed files with 365 additions and 205 deletions
|
@ -467,18 +467,18 @@ void JsonApiServer::registerHandler(
|
|||
const std::function<void (const std::shared_ptr<rb::Session>)>& callback )
|
||||
{
|
||||
/* Declare outside the lambda to avoid returning a dangling
|
||||
* reference on Android */
|
||||
* reference */
|
||||
RsWarn tWarn;
|
||||
const auto authFail =
|
||||
[&](int status) -> RsWarn::stream_type&
|
||||
[&](int status) -> std::ostream&
|
||||
{
|
||||
/* Capture session by reference as it is cheaper then copying
|
||||
* shared_ptr by value which is not needed in this case */
|
||||
|
||||
session->close(status, corsOptionsHeaders);
|
||||
return tWarn << "JsonApiServer authentication handler "
|
||||
"blocked an attempt to call JSON API "
|
||||
"authenticated method: " << path;
|
||||
"blocked an attempt to call JSON API "
|
||||
"authenticated method: " << path;
|
||||
};
|
||||
|
||||
if(session->get_request()->get_method() == "OPTIONS")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue