mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-25 05:07:38 +01:00
commit
26e70b2588
5 changed files with 30 additions and 16 deletions
|
@ -110,6 +110,7 @@ namespace client
|
||||||
const decltype(m_ServerTunnels)& GetServerTunnels () const { return m_ServerTunnels; };
|
const decltype(m_ServerTunnels)& GetServerTunnels () const { return m_ServerTunnels; };
|
||||||
const decltype(m_ClientForwards)& GetClientForwards () const { return m_ClientForwards; }
|
const decltype(m_ClientForwards)& GetClientForwards () const { return m_ClientForwards; }
|
||||||
const decltype(m_ServerForwards)& GetServerForwards () const { return m_ServerForwards; }
|
const decltype(m_ServerForwards)& GetServerForwards () const { return m_ServerForwards; }
|
||||||
|
const i2p::proxy::HTTPProxy * GetHttpProxy () const { return m_HttpProxy; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ClientContext context;
|
extern ClientContext context;
|
||||||
|
|
6
FS.cpp
6
FS.cpp
|
@ -66,9 +66,11 @@ namespace fs {
|
||||||
return;
|
return;
|
||||||
#else /* other unix */
|
#else /* other unix */
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
if (boost::filesystem::exists("/sdcard"))
|
const char * ext = getenv("EXTERNAL_STORAGE");
|
||||||
|
if (!ext) ext = "/sdcard";
|
||||||
|
if (boost::filesystem::exists(ext))
|
||||||
{
|
{
|
||||||
dataDir = "/sdcard/" + appName;
|
dataDir = std::string (ext) + "/" + appName;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// otherwise use /data/files
|
// otherwise use /data/files
|
||||||
|
|
|
@ -549,6 +549,15 @@ namespace http {
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
s << "<br>\r\n"<< std::endl;
|
s << "<br>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
|
auto httpProxy = i2p::client::context.GetHttpProxy ();
|
||||||
|
if (httpProxy)
|
||||||
|
{
|
||||||
|
auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash();
|
||||||
|
s << "<a href=\"/?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
|
s << "HTTP Proxy" << "</a> ⇐ ";
|
||||||
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
|
s << "<br>\r\n"<< std::endl;
|
||||||
|
}
|
||||||
s << "<br>\r\n<b>Server Tunnels:</b><br>\r\n<br>\r\n";
|
s << "<br>\r\n<b>Server Tunnels:</b><br>\r\n<br>\r\n";
|
||||||
for (auto& it: i2p::client::context.GetServerTunnels ())
|
for (auto& it: i2p::client::context.GetServerTunnels ())
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,7 @@ namespace client
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::shared_ptr<ClientDestination> GetLocalDestination () { return m_LocalDestination; }
|
inline std::shared_ptr<ClientDestination> GetLocalDestination () { return m_LocalDestination; }
|
||||||
|
inline std::shared_ptr<const ClientDestination> GetLocalDestination () const { return m_LocalDestination; }
|
||||||
inline void SetLocalDestination (std::shared_ptr<ClientDestination> dest) { m_LocalDestination = dest; }
|
inline void SetLocalDestination (std::shared_ptr<ClientDestination> dest) { m_LocalDestination = dest; }
|
||||||
void CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, int port = 0);
|
void CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, int port = 0);
|
||||||
|
|
||||||
|
|
|
@ -184,10 +184,11 @@ namespace tunnel
|
||||||
|
|
||||||
void Tunnel::PrintHops (std::stringstream& s) const
|
void Tunnel::PrintHops (std::stringstream& s) const
|
||||||
{
|
{
|
||||||
for (auto& it: m_Hops)
|
// hops are in inverted order, we must print in direct order
|
||||||
|
for (auto it = m_Hops.rbegin (); it != m_Hops.rend (); it++)
|
||||||
{
|
{
|
||||||
s << " ⇒ ";
|
s << " ⇒ ";
|
||||||
s << i2p::data::GetIdentHashAbbreviation (it->ident->GetIdentHash ());
|
s << i2p::data::GetIdentHashAbbreviation ((*it)->ident->GetIdentHash ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue