Add extra debug logging.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2020-08-24 16:52:20 +02:00
parent 739f5d4b3b
commit c04ad4b4ab
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 10 additions and 1 deletions

View File

@ -54,6 +54,7 @@ Document::Document(Config &cfg)
, _profiledata{_cfg.profiledata}
{
RestClient::init();
BOOST_LOG_TRIVIAL(debug) << "Initialized RestClient.";
download();
}
@ -65,12 +66,20 @@ Document::~Document()
void Document::download(const string &uri, const bool temp_redirect)
{
BOOST_LOG_TRIVIAL(debug) << "Downloading <" << uri << "> …";
RestClient::Connection connection{uri};
connection.SetUserAgent(string("mastorss/").append(version));
connection.FollowRedirects(false);
RestClient::Response response{connection.get("")};
BOOST_LOG_TRIVIAL(debug) << "Got response: " << response.code;
BOOST_LOG_TRIVIAL(debug) << "Got Headers:";
for (const auto &header : response.headers)
{
BOOST_LOG_TRIVIAL(debug) << header.first << ": " << header.second;
}
switch (response.code)
{
case 200:
@ -104,7 +113,7 @@ void Document::download(const string &uri, const bool temp_redirect)
case 303:
case 307:
{
temporary_redirect:
temporary_redirect:
const string newuri{extract_location(response.headers)};
if (newuri.empty())
{