Browse Source

update build files and allow compile without websocket

pull/695/head
Jeff Becker 8 years ago
parent
commit
1a1d54387c
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 9
      Daemon.cpp
  2. 6
      Makefile
  3. 2
      filelist.mk

9
Daemon.cpp

@ -41,7 +41,9 @@ namespace i2p @@ -41,7 +41,9 @@ namespace i2p
std::unique_ptr<i2p::http::HTTPServer> httpServer;
std::unique_ptr<i2p::client::I2PControlService> m_I2PControlService;
std::unique_ptr<i2p::transport::UPnP> UPnP;
#ifdef WITH_EVENTS
std::unique_ptr<i2p::event::WebsocketServer> m_WebsocketServer;
#endif
};
Daemon_Singleton::Daemon_Singleton() : isDaemon(false), running(true), d(*new Daemon_Singleton_Private()) {}
@ -294,6 +296,7 @@ namespace i2p @@ -294,6 +296,7 @@ namespace i2p
d.m_I2PControlService = std::unique_ptr<i2p::client::I2PControlService>(new i2p::client::I2PControlService (i2pcpAddr, i2pcpPort));
d.m_I2PControlService->Start ();
}
#ifdef WITH_EVENTS
bool websocket; i2p::config::GetOption("websockets.enabled", websocket);
if(websocket) {
@ -305,7 +308,7 @@ namespace i2p @@ -305,7 +308,7 @@ namespace i2p
i2p::event::core.SetListener(d.m_WebsocketServer->ToListener());
}
#endif
return true;
}
@ -338,13 +341,13 @@ namespace i2p @@ -338,13 +341,13 @@ namespace i2p
d.m_I2PControlService->Stop ();
d.m_I2PControlService = nullptr;
}
#ifdef WITH_EVENTS
if (d.m_WebsocketServer) {
LogPrint(eLogInfo, "Daemon: stopping Websocket server");
d.m_WebsocketServer->Stop();
d.m_WebsocketServer = nullptr;
}
#endif
i2p::crypto::TerminateCrypto ();
return true;

6
Makefile

@ -14,6 +14,12 @@ USE_STATIC := no @@ -14,6 +14,12 @@ USE_STATIC := no
USE_MESHNET := no
USE_UPNP := no
ifeq ($(WEBSOCKET),1)
NEEDED_CXXFLAGS += -DWITH_EVENTS
DAEMON_SRC += Websocket.cpp
endif
ifeq ($(UNAME),Darwin)
DAEMON_SRC += DaemonLinux.cpp
ifeq ($(HOMEBREW),1)

2
filelist.mk

@ -5,7 +5,7 @@ LIB_SRC = \ @@ -5,7 +5,7 @@ LIB_SRC = \
SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \
Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \
Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \
Config.cpp HTTP.cpp Timestamp.cpp util.cpp api.cpp
Config.cpp HTTP.cpp Timestamp.cpp util.cpp api.cpp Event.cpp
LIB_CLIENT_SRC = \
AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp \

Loading…
Cancel
Save