Browse Source

[win] update status code

Signed-off-by: r4sas <r4sas@i2pmail.org>
pull/2047/head
R4SAS 9 months ago
parent
commit
a30d1972e5
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 24
      Win32/Win32App.cpp

24
Win32/Win32App.cpp

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2022, The PurpleI2P Project * Copyright (c) 2013-2024, The PurpleI2P Project
* *
* This file is part of Purple i2pd project and licensed under BSD3 * This file is part of Purple i2pd project and licensed under BSD3
* *
@ -145,7 +145,7 @@ namespace win32
s << bytes << " Bytes\n"; s << bytes << " Bytes\n";
} }
static void ShowNetworkStatus (std::stringstream& s, RouterStatus status, bool testing) static void ShowNetworkStatus (std::stringstream& s, RouterStatus status, bool testing, RouterError error)
{ {
switch (status) switch (status)
{ {
@ -158,18 +158,24 @@ namespace win32
}; };
if (testing) if (testing)
s << " (Test)"; s << " (Test)";
if (i2p::context.GetError () != eRouterErrorNone) if (error != eRouterErrorNone)
{ {
switch (i2p::context.GetError ()) switch (error)
{ {
case eRouterErrorClockSkew: case eRouterErrorClockSkew:
s << " - Clock skew"; s << " - " << tr("Clock skew");
break; break;
case eRouterErrorOffline: case eRouterErrorOffline:
s << " - Offline"; s << " - " << tr("Offline");
break; break;
case eRouterErrorSymmetricNAT: case eRouterErrorSymmetricNAT:
s << " - Symmetric NAT"; s << " - " << tr("Symmetric NAT");
break;
case eRouterErrorFullConeNAT:
s << " - " << tr("Full cone NAT");
break;
case eRouterErrorNoDescriptors:
s << " - " << tr("No Descriptors");
break; break;
default: ; default: ;
} }
@ -180,11 +186,11 @@ namespace win32
{ {
s << "\n"; s << "\n";
s << "Status: "; s << "Status: ";
ShowNetworkStatus (s, i2p::context.GetStatus (), i2p::context.GetTesting ()); ShowNetworkStatus (s, i2p::context.GetStatus (), i2p::context.GetTesting(), i2p::context.GetError ());
if (i2p::context.SupportsV6 ()) if (i2p::context.SupportsV6 ())
{ {
s << " / "; s << " / ";
ShowNetworkStatus (s, i2p::context.GetStatusV6 (), i2p::context.GetTestingV6 ()); ShowNetworkStatus (s, i2p::context.GetStatusV6 (), i2p::context.GetTestingV6(), i2p::context.GetErrorV6 ());
} }
s << "; "; s << "; ";
s << "Success Rate: " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate() << "%\n"; s << "Success Rate: " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate() << "%\n";

Loading…
Cancel
Save