Browse Source

merge

pull/695/head
Jeff Becker 8 years ago
parent
commit
d4a0076aba
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 4
      Daemon.cpp
  2. 2
      Event.cpp
  3. 2
      Makefile
  4. 2
      SSUData.cpp
  5. 3
      Transports.cpp
  6. 2
      Tunnel.cpp
  7. 3
      TunnelPool.cpp
  8. 2
      Websocket.h

4
Daemon.cpp

@ -314,7 +314,9 @@ namespace i2p @@ -314,7 +314,9 @@ namespace i2p
bool Daemon_Singleton::stop()
{
#ifdef WITH_EVENTS
i2p::event::core.SetListener(nullptr);
#endif
LogPrint(eLogInfo, "Daemon: shutting down");
LogPrint(eLogInfo, "Daemon: stopping Client");
i2p::client::context.Stop();
@ -352,5 +354,5 @@ namespace i2p @@ -352,5 +354,5 @@ namespace i2p
return true;
}
}
}
}

2
Event.cpp

@ -23,6 +23,8 @@ namespace i2p @@ -23,6 +23,8 @@ namespace i2p
void EmitEvent(const EventType & e)
{
#ifdef WITH_EVENTS
i2p::event::core.QueueEvent(e);
#endif
}

2
Makefile

@ -15,7 +15,7 @@ USE_MESHNET := no @@ -15,7 +15,7 @@ USE_MESHNET := no
USE_UPNP := no
ifeq ($(WEBSOCKET),1)
ifeq ($(WEBSOCKETS),1)
NEEDED_CXXFLAGS += -DWITH_EVENTS
DAEMON_SRC += Websocket.cpp
endif

2
SSUData.cpp

@ -234,7 +234,7 @@ namespace transport @@ -234,7 +234,7 @@ namespace transport
if (!m_ReceivedMessages.count (msgID))
{
m_ReceivedMessages.insert (msgID);
m_LastMessageReceivedTime = i2p::util::GetSinceEpoch<Time> ();
m_LastMessageReceivedTime = i2p::util::GetSecondsSinceEpoch ();
if (!msg->IsExpired ()) {
EmitEvent({{"type", "transport.recvmsg"} , {"ident", m_Session.GetIdentHashBase64()}, {"number", "1"}});
m_Handler.PutNextMessage (msg);

3
Transports.cpp

@ -231,7 +231,6 @@ namespace transport @@ -231,7 +231,6 @@ namespace transport
void Transports::SendMessages (const i2p::data::IdentHash& ident, const std::vector<std::shared_ptr<i2p::I2NPMessage> >& msgs)
{
EmitEvent({{"type" , "transport.sendmsg"}, {"ident", ident.ToBase64()}, {"number", std::to_string(msgs.size())}});
m_Service.post (std::bind (&Transports::PostMessages, this, ident, msgs));
}
@ -510,7 +509,6 @@ namespace transport @@ -510,7 +509,6 @@ namespace transport
bool nat; i2p::config::GetOption("nat", nat);
if (nat)
i2p::context.SetStatus (eRouterStatusTesting);
for (int i = 0; i < 5; i++)
{
auto router = i2p::data::netdb.GetRandomPeerTestRouter ();
@ -573,7 +571,6 @@ namespace transport @@ -573,7 +571,6 @@ namespace transport
if (it != m_Peers.end ())
{
EmitEvent({{"type" , "transport.connected"}, {"ident", ident.ToBase64()}, {"inbound", "false"}});
bool sendDatabaseStore = true;
if (it->second.delayedMessages.size () > 0)
{

2
Tunnel.cpp

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
#include "Transports.h"
#include "NetDb.h"
#include "Tunnel.h"
#include "TunnelPool.h"
namespace i2p
{
@ -65,7 +66,6 @@ namespace tunnel @@ -65,7 +66,6 @@ namespace tunnel
#ifdef WITH_EVENTS
EmitTunnelEvent("tunnel.build", this, peers);
#endif
// fill up fake records with random data
for (int i = numHops; i < numRecords; i++)
{

3
TunnelPool.cpp

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
#include "Garlic.h"
#include "Transports.h"
#include "Log.h"
#include "Tunnel.h"
#include "TunnelPool.h"
#include "Destination.h"
#include "Event.h"
@ -83,7 +84,6 @@ namespace tunnel @@ -83,7 +84,6 @@ namespace tunnel
if (expiredTunnel)
{
EmitTunnelEvent("tunnels.expired", expiredTunnel);
expiredTunnel->SetTunnelPool (nullptr);
for (auto& it: m_Tests)
if (it.second.second == expiredTunnel) it.second.second = nullptr;
@ -109,7 +109,6 @@ namespace tunnel @@ -109,7 +109,6 @@ namespace tunnel
if (expiredTunnel)
{
EmitTunnelEvent("tunnels.expired", expiredTunnel);
expiredTunnel->SetTunnelPool (nullptr);
for (auto& it: m_Tests)
if (it.second.first == expiredTunnel) it.second.first = nullptr;

2
Websocket.h

@ -1,8 +1,6 @@ @@ -1,8 +1,6 @@
#ifndef WEBSOCKET_H__
#define WEBSOCKET_H__
#include "Event.h"
namespace i2p
{
namespace event

Loading…
Cancel
Save