Merge lp:~widelands-dev/widelands/net-more-resolve-logging into lp:widelands

Proposed by Notabilis
Status: Merged
Merged at revision: 9149
Proposed branch: lp:~widelands-dev/widelands/net-more-resolve-logging
Merge into: lp:widelands
Diff against target: 24 lines (+6/-1)
1 file modified
src/network/network.cc (+6/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/net-more-resolve-logging
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+368955@code.launchpad.net

Commit message

More log output if trying to resolve network addresses

Description of the change

Some more log output to help debug network problems.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5197. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/547099205.
Appveyor build 4976. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_net_more_resolve_logging-4976.

Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM :)

inputqueues

@bunnybot merge force

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/network/network.cc'
2--- src/network/network.cc 2019-02-23 11:00:49 +0000
3+++ src/network/network.cc 2019-06-18 06:13:12 +0000
4@@ -38,14 +38,19 @@
5 boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(query);
6 if (iter == boost::asio::ip::tcp::resolver::iterator()) {
7 // Resolution failed
8+ log("Could not resolve network name '%s:%u' to %s-address\n", hostname.c_str(),
9+ port, ((protocol == boost::asio::ip::tcp::v4()) ? "IPv4" : "IPv6"));
10 return false;
11 }
12 addr->ip = iter->endpoint().address();
13 addr->port = port;
14+ log("Resolved network name '%s:%u' to %s\n",
15+ hostname.c_str(), port, addr->ip.to_string().c_str());
16 return true;
17 } catch (const boost::system::system_error& ec) {
18 // Resolution failed
19- log("Could not resolve network name: %s\n", ec.what());
20+ log("Could not resolve network name '%s:%u' to %s-address: %s\n", hostname.c_str(),
21+ port, ((protocol == boost::asio::ip::tcp::v4()) ? "IPv4" : "IPv6"), ec.what());
22 return false;
23 }
24 }

Subscribers

People subscribed via source and target branches

to status/vote changes: