Browse Source

netdb.cpp:

* explicitly define replyIdent

Daemon.cpp:
* wait for 1 second before checking if transports are bound to wait for transports to bind
pull/557/head
Jeff Becker 9 years ago
parent
commit
b8a205f755
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 1
      Daemon.cpp
  2. 9
      NetDb.cpp

1
Daemon.cpp

@ -257,6 +257,7 @@ namespace i2p @@ -257,6 +257,7 @@ namespace i2p
bool ssu; i2p::config::GetOption("ssu", ssu);
LogPrint(eLogInfo, "Daemon: starting Transports");
i2p::transport::transports.Start(ntcp, ssu);
std::this_thread::sleep_for(std::chrono::seconds(1));
if (i2p::transport::transports.IsBoundNTCP() || i2p::transport::transports.IsBoundSSU()) {
LogPrint(eLogInfo, "Daemon: Transports started");
} else {

9
NetDb.cpp

@ -617,6 +617,9 @@ namespace data @@ -617,6 +617,9 @@ namespace data
int l = i2p::data::ByteStreamToBase64 (buf, 32, key, 48);
key[l] = 0;
uint8_t flag = buf[64];
IdentHash replyIdent(buf + 32);
LogPrint (eLogDebug, "NetDb: DatabaseLookup for ", key, " recieved flags=", (int)flag);
uint8_t lookupType = flag & DATABASE_LOOKUP_TYPE_FLAGS_MASK;
const uint8_t * excluded = buf + 65;
@ -739,12 +742,12 @@ namespace data @@ -739,12 +742,12 @@ namespace data
auto exploratoryPool = i2p::tunnel::tunnels.GetExploratoryPool ();
auto outbound = exploratoryPool ? exploratoryPool->GetNextOutboundTunnel () : nullptr;
if (outbound)
outbound->SendTunnelDataMsg (buf+32, replyTunnelID, replyMsg);
outbound->SendTunnelDataMsg (replyIdent, replyTunnelID, replyMsg);
else
transports.SendMessage (buf+32, i2p::CreateTunnelGatewayMsg (replyTunnelID, replyMsg));
transports.SendMessage (replyIdent, i2p::CreateTunnelGatewayMsg (replyTunnelID, replyMsg));
}
else
transports.SendMessage (buf+32, replyMsg);
transports.SendMessage (replyIdent, replyMsg);
}
}

Loading…
Cancel
Save