mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
merge
This commit is contained in:
parent
cd9cd84c5b
commit
d4a0076aba
|
@ -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
|
|||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace i2p
|
|||
|
||||
void EmitEvent(const EventType & e)
|
||||
{
|
||||
#ifdef WITH_EVENTS
|
||||
i2p::event::core.QueueEvent(e);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
2
Makefile
2
Makefile
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
|||
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
|
|||
if (it != m_Peers.end ())
|
||||
{
|
||||
EmitEvent({{"type" , "transport.connected"}, {"ident", ident.ToBase64()}, {"inbound", "false"}});
|
||||
|
||||
bool sendDatabaseStore = true;
|
||||
if (it->second.delayedMessages.size () > 0)
|
||||
{
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "Transports.h"
|
||||
#include "NetDb.h"
|
||||
#include "Tunnel.h"
|
||||
#include "TunnelPool.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -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
|
|||
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
|
|||
if (expiredTunnel)
|
||||
{
|
||||
EmitTunnelEvent("tunnels.expired", expiredTunnel);
|
||||
|
||||
expiredTunnel->SetTunnelPool (nullptr);
|
||||
for (auto& it: m_Tests)
|
||||
if (it.second.first == expiredTunnel) it.second.first = nullptr;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef WEBSOCKET_H__
|
||||
#define WEBSOCKET_H__
|
||||
#include "Event.h"
|
||||
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace event
|
||||
|
|
Loading…
Reference in a new issue