From 587bf4e8207868e3aa348222b11320c3de1806db Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 7 Dec 2018 12:47:23 -0800 Subject: [PATCH] modules/console: Fix hostport parse; fix peer.hostcanon reference. --- modules/console.cc | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index de6dbefa9..700ca9726 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -3289,7 +3289,7 @@ console_cmd__peer(opt &out, const string_view &line) server::find(hostport) }; - print(peer.hostname, peer); + print(peer.hostcanon, peer); return true; } @@ -3561,20 +3561,14 @@ catch(const std::out_of_range &e) bool console_cmd__net__host(opt &out, const string_view &line) { - const params token + const params param{line, " ", { - line, " ", {"host", "service"} - }; - - const auto &host{token.at(0)}; - const auto &service - { - token.count() > 1? token.at(1) : string_view{} - }; + "hostport" + }}; const net::hostport hostport { - host, service + param["hostport"] }; ctx::dock dock;