Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jenny Ryan
ouinet
Commits
f5280f99
Commit
f5280f99
authored
Dec 17, 2020
by
Ivan Vilata-i-Balaguer
Browse files
Turn some client debug messages into warnings and errors.
Also show error code in some pending cases.
parent
019284d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/client.cpp
View file @
f5280f99
...
...
@@ -79,6 +79,8 @@
#include "logger.h"
#define _YDEBUG(y, ...) do { if (logger.get_threshold() <= DEBUG) y.log(DEBUG, __VA_ARGS__); } while (false)
#define _YWARN(y, ...) do { if (logger.get_threshold() <= WARN) y.log(WARN, __VA_ARGS__); } while (false)
#define _YERROR(y, ...) do { if (logger.get_threshold() <= ERROR) y.log(ERROR, __VA_ARGS__); } while (false)
using
namespace
std
;
using
namespace
ouinet
;
...
...
@@ -600,7 +602,7 @@ Client::State::fetch_via_self( Rq request, const UserAgentMetaData& meta
assert
(
!
cancel
||
ec
==
asio
::
error
::
operation_aborted
);
if
(
ec
)
{
_Y
DEBUG
(
yield
,
"Failed to connect to self ec:"
,
ec
.
message
());
_Y
ERROR
(
yield
,
"Failed to connect to self ec:"
,
ec
.
message
());
return
or_throw
<
Session
>
(
yield
,
ec
);
}
...
...
@@ -630,7 +632,7 @@ Client::State::fetch_via_self( Rq request, const UserAgentMetaData& meta
}
if
(
ec
)
{
_Y
DEBUG
(
yield
,
"Failed to send request to self
"
);
_Y
ERROR
(
yield
,
"Failed to send request to self
ec:"
,
ec
.
message
()
);
}
if
(
ec
)
return
or_throw
<
Session
>
(
yield
,
ec
);
...
...
@@ -995,7 +997,7 @@ Session Client::State::fetch_fresh_through_simple_proxy
assert
(
!
cancel
||
ec
==
asio
::
error
::
operation_aborted
);
if
(
ec
)
{
_Y
DEBUG
(
yield
,
"Failed to connect to injector ec:"
,
ec
.
message
());
_Y
WARN
(
yield
,
"Failed to connect to injector ec:"
,
ec
.
message
());
return
or_throw
<
Session
>
(
yield
,
ec
);
}
...
...
@@ -1032,7 +1034,7 @@ Session Client::State::fetch_fresh_through_simple_proxy
}
if
(
ec
)
{
_Y
DEBUG
(
yield
,
"Failed to send request to the injector
"
);
_Y
WARN
(
yield
,
"Failed to send request to the injector
ec:"
,
ec
.
message
()
);
}
if
(
ec
)
return
or_throw
<
Session
>
(
yield
,
ec
);
...
...
@@ -1308,7 +1310,7 @@ public:
auto
injector_error
=
rsh
[
http_
::
response_error_hdr
];
if
(
!
injector_error
.
empty
())
{
_Y
DEBUG
(
yield
,
"Error from injector: "
,
injector_error
);
_Y
ERROR
(
yield
,
"Error from injector: "
,
injector_error
);
return
or_throw
(
yield
,
err
::
invalid_argument
);
}
...
...
@@ -2016,7 +2018,7 @@ void Client::State::serve_request( GenericStream&& con
// Subsequent access to the connection will use the encrypted channel.
con
=
ssl_mitm_handshake
(
move
(
con
),
req
,
yield
[
ec
].
tag
(
"mitm_hanshake"
));
if
(
ec
)
{
_Y
DEBUG
(
yield
,
"Mitm exception: "
,
ec
.
message
());
_Y
ERROR
(
yield
,
"Mitm exception: "
,
ec
.
message
());
return
;
}
mitm
=
true
;
...
...
@@ -2081,7 +2083,7 @@ void Client::State::serve_request( GenericStream&& con
cache_control
.
mixed_fetch
(
tnx
,
yield
[
ec
].
tag
(
"mixed_fetch"
));
if
(
ec
)
{
_Y
DEBUG
(
yield
,
"error writing back response: "
,
ec
.
message
());
_Y
ERROR
(
yield
,
"error writing back response: "
,
ec
.
message
());
if
(
!
tnx
.
user_agent_was_written_to
()
&&
!
cancel
&&
con
.
is_open
())
{
sys
::
error_code
ec_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment