Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #83
Browse files Browse the repository at this point in the history
ab6fae4 Cherry-pick remaining doc/crypto commits from #81 (anonimal)
47223f8 Cherry-pick commits from #81. (anonimal)
661b002 Revert #81 before cherry-picking. (anonimal)
  • Loading branch information
anonimal committed Jan 27, 2016
2 parents 4b10a3c + ab6fae4 commit d36d7d8
Show file tree
Hide file tree
Showing 28 changed files with 133 additions and 768 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ option(WITH_OPTIMIZE "Optimization flags" OFF)
option(WITH_STATIC "Static build" OFF)
option(WITH_TESTS "Build unit tests" OFF)
option(WITH_UPNP "Include support for UPnP client" OFF)
option(WITH_LUA "Build lua interpreter" OFF)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
Expand Down Expand Up @@ -204,7 +203,6 @@ message(STATUS " OPTIMIZATION : ${WITH_OPTIMIZE}")
message(STATUS " STATIC BUILD : ${WITH_STATIC}")
message(STATUS " TESTS : ${WITH_TESTS}")
message(STATUS " UPnP : ${WITH_UPNP}")
message(STATUS " Lua Interpreter : ${WITH_LUA}")
message(STATUS "---------------------------------------")

# Handle paths nicely
Expand Down
67 changes: 0 additions & 67 deletions build/cmake/FindLuaJIT.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions contrib/i2lua/README.md

This file was deleted.

37 changes: 0 additions & 37 deletions contrib/i2lua/example.lua

This file was deleted.

50 changes: 22 additions & 28 deletions src/client/Daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "transport/NTCPSession.h"
#include "transport/Transports.h"
#include "tunnel/Tunnel.h"
#include "util/Filesystem.h"

namespace i2p {
namespace util {
Expand All @@ -63,14 +62,9 @@ bool Daemon_Singleton::IsService() const {

// TODO(anonimal): find a better way to initialize
bool Daemon_Singleton::Init() {
i2p::context.InitFrom(i2p::util::filesystem::GetFullPath(i2p::ROUTER_KEYS),
i2p::util::filesystem::GetFullPath(i2p::ROUTER_INFO));
i2p::context.Init();
m_IsDaemon = i2p::util::config::varMap["daemon"].as<bool>();
m_IsLogging = i2p::util::config::varMap["log"].as<bool>();
// stop logging if we specifiy no logging
if (!m_IsLogging) {
m_log->Stop();
}
int port = i2p::util::config::varMap["port"].as<int>();
i2p::context.UpdatePort(port);
i2p::context.UpdateAddress(
Expand Down Expand Up @@ -107,29 +101,29 @@ bool Daemon_Singleton::Start() {
} else {
StartLog(""); // write to stdout
}
}
try {
LogPrint("Starting NetDB...");
if (i2p::data::netdb.Start()) {
LogPrint("NetDB started");
} else {
LogPrint("NetDB failed to start");
try {
LogPrint("Starting NetDB...");
if (i2p::data::netdb.Start()) {
LogPrint("NetDB started");
} else {
LogPrint("NetDB failed to start");
return false;
}
LogPrint("Starting transports...");
i2p::transport::transports.Start();
LogPrint("Transports started");

LogPrint("Starting tunnels...");
i2p::tunnel::tunnels.Start();
LogPrint("Tunnels started");

LogPrint("Starting client...");
i2p::client::context.Start();
LogPrint("Client started");
} catch (std::runtime_error& e) {
LogPrint(eLogError, e.what());
return false;
}
LogPrint("Starting transports...");
i2p::transport::transports.Start();
LogPrint("Transports started");

LogPrint("Starting tunnels...");
i2p::tunnel::tunnels.Start();
LogPrint("Tunnels started");

LogPrint("Starting client...");
i2p::client::context.Start();
LogPrint("Client started");
} catch (std::runtime_error& e) {
LogPrint(eLogError, e.what());
return false;
}
return true;
}
Expand Down
34 changes: 0 additions & 34 deletions src/core/Alloc.h

This file was deleted.

13 changes: 0 additions & 13 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,6 @@ if(WITH_LIBRARY)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

if(WITH_LUA)
find_package("LuaJIT")
set(LUA_NAME "i2lua")
set(LUA_SRC
"lua/Main.cpp"
"lua/NetDB.cpp"
)
include_directories(${LUAJIT_INCLUDE_DIR})
add_executable(${LUA_NAME} ${LUA_SRC})
target_link_libraries(${LUA_NAME} ${LUAJIT_LIBRARIES} ${CORE_NAME})
endif()

endif()

# vim: noai:ts=2:sw=2
13 changes: 0 additions & 13 deletions src/core/NetworkDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,19 +370,6 @@ void NetDb::Load() {
LogPrint(m_Floodfills.size(), " floodfills loaded");
}

std::shared_ptr<const RouterInfo> NetDb::GetRouterByHash(IdentHash & ih) const {
std::shared_ptr<const RouterInfo> ri = nullptr;
{
std::lock_guard<std::mutex> lock(m_RouterInfosMutex);
auto itr = m_RouterInfos.find(ih);
if (itr != m_RouterInfos.end()) {
// exists
ri = itr->second;
}
}
return ri;
}

void NetDb::SaveUpdated() {
auto GetFilePath = [](
const boost::filesystem::path& directory,
Expand Down
2 changes: 0 additions & 2 deletions src/core/NetworkDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ class NetDb {
void HandleDatabaseLookupMsg(
std::shared_ptr<const I2NPMessage> msg);


std::shared_ptr<const RouterInfo> GetRouterByHash(IdentHash & ih) const;
std::shared_ptr<const RouterInfo> GetRandomRouter() const;
std::shared_ptr<const RouterInfo> GetRandomRouter(
std::shared_ptr<const RouterInfo> compatibleWith) const;
Expand Down
Loading

0 comments on commit d36d7d8

Please sign in to comment.