mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Fix values
This commit is contained in:
parent
d930947853
commit
4032a611bf
9 changed files with 22 additions and 23 deletions
|
@ -318,7 +318,7 @@ namespace client
|
|||
|
||||
std::shared_ptr<const Address> AddressBook::GetAddress (const std::string& address)
|
||||
{
|
||||
auto pos = address.find(".b32.dotnet");
|
||||
auto pos = address.find(".dot.net");
|
||||
if (pos != std::string::npos)
|
||||
return std::make_shared<const Address>(address.substr (0, pos));
|
||||
else
|
||||
|
@ -332,7 +332,7 @@ namespace client
|
|||
return addr;
|
||||
}
|
||||
}
|
||||
// if not .b32 we assume full base64 address
|
||||
// if not .dot.net we assume full base64 address
|
||||
dotnet::data::IdentityEx dest;
|
||||
if (!dest.FromBase64 (address))
|
||||
return nullptr;
|
||||
|
@ -349,7 +349,7 @@ namespace client
|
|||
|
||||
void AddressBook::InsertAddress (const std::string& address, const std::string& jump)
|
||||
{
|
||||
auto pos = jump.find(".b32.dotnet");
|
||||
auto pos = jump.find(".dot.net");
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
m_Addresses[address] = std::make_shared<Address>(jump.substr (0, pos));
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace client
|
|||
bool IsIdentHash () const { return addressType == eAddressIndentHash; };
|
||||
};
|
||||
|
||||
inline std::string GetB32Address(const dotnet::data::IdentHash& ident) { return ident.ToBase32().append(".b32.dotnet"); }
|
||||
inline std::string GetB32Address(const dotnet::data::IdentHash& ident) { return ident.ToBase32().append(".dot.net"); }
|
||||
|
||||
class AddressBookStorage // interface for storage
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ namespace client
|
|||
|
||||
bool LoadHostsFromStream (std::istream& f, bool is_update);
|
||||
void DownloadComplete (bool success, const dotnet::data::IdentHash& subscription, const std::string& etag, const std::string& lastModified);
|
||||
//This method returns the ".b32.dotnet" address
|
||||
//This method returns the ".dot.net" address
|
||||
std::string ToAddress(const dotnet::data::IdentHash& ident) { return GetB32Address(ident); }
|
||||
std::string ToAddress(std::shared_ptr<const dotnet::data::IdentityEx> ident) { return ToAddress(ident->GetIdentHash ()); }
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace client
|
|||
// for HTTP tunnels
|
||||
const char X_DOTNET_DEST_HASH[] = "X-DOTNET-DestHash"; // hash in base64
|
||||
const char X_DOTNET_DEST_B64[] = "X-DOTNET-DestB64"; // full address in base64
|
||||
const char X_DOTNET_DEST_B32[] = "X-DOTNET-DestB32"; // .b32.dotnet address
|
||||
const char X_DOTNET_DEST_B32[] = "X-DOTNET-DestB32"; // .dot.net address
|
||||
|
||||
class DotNetTunnelConnection: public DotNetServiceHandler, public std::enable_shared_from_this<DotNetTunnelConnection>
|
||||
{
|
||||
|
|
|
@ -23,13 +23,12 @@
|
|||
namespace dotnet {
|
||||
namespace proxy {
|
||||
std::map<std::string, std::string> jumpservices = {
|
||||
{ "inr.dotnet", "http://joajgazyztfssty4w2on5oaqksz6tqoxbduy553y34mf4byv6gpq.b32.dotnet/search/?q=" },
|
||||
{ "stats.dotnet", "http://7tbay5p4kzeekxvyvbf6v7eauazemsnnl2aoyqhg5jzpr5eke7tq.b32.dotnet/cgi-bin/jump.cgi?a=" },
|
||||
{ "dot.net", "http://f26brxp77ydqc7cnjctnj75ktcgjhh3tqqvrgf4a6l25aqk3vp3a.dot.net/search/?q=" },
|
||||
};
|
||||
|
||||
static const char *pageHead =
|
||||
"<head>\r\n"
|
||||
" <title>DOTNET HTTP proxy</title>\r\n"
|
||||
" <title>.NET HTTP proxy</title>\r\n"
|
||||
" <style type=\"text/css\">\r\n"
|
||||
" body { font: 100%/1.5em sans-serif; margin: 0; padding: 1.5em; background: #FAFAFA; color: #103456; }\r\n"
|
||||
" .header { font-size: 2.5em; text-align: center; margin: 1.5em 0; color: #894C84; }\r\n"
|
||||
|
|
|
@ -209,7 +209,7 @@ namespace client
|
|||
{
|
||||
std::stringstream ss;
|
||||
ss << from.GetIdentHash().ToBase32();
|
||||
ss << ".b32.dotnet:";
|
||||
ss << ".dot.net:";
|
||||
ss << std::to_string(fromPort);
|
||||
ss << "\n";
|
||||
ss.write((char *)buf, len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue