disable lokinet-bootstrap on windows builds

pull/1969/head
Jeff Becker 2 years ago
parent 871c3e3281
commit 7f27760c97
No known key found for this signature in database
GPG Key ID: 025C02EE3A092F2D

@ -21,6 +21,7 @@ cmake \
-DBUILD_TESTING=OFF \
-DBUILD_LIBLOKINET=OFF \
-DWITH_TESTS=OFF \
-DWITH_BOOTSTRAP=OFF \
-DNATIVE_BUILD=OFF \
-DSTATIC_LINK=ON \
-DWITH_SYSTEMD=OFF \

@ -55,7 +55,6 @@ endif()
foreach(exe ${exetargets})
if(WIN32)
target_sources(${exe} PRIVATE ${CMAKE_BINARY_DIR}/${exe}.rc)
target_compile_options(${exe} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-fpermissive>)
target_link_libraries(${exe} PRIVATE -static-libstdc++ -static-libgcc --static -Wl,--pic-executable,-e,mainCRTStartup,--subsystem,console:5.00)
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
target_link_directories(${exe} PRIVATE /usr/local/lib)

@ -680,7 +680,7 @@ win32_daemon_entry(DWORD argc, LPTSTR* argv)
ReportSvcStatus(SERVICE_START_PENDING, NO_ERROR, 3000);
// SCM clobbers startup args, regenerate them here
argc = 2;
argv[1] = strdup("c:/programdata/lokinet/lokinet.ini");
argv[1] = strdup("c:\\programdata\\lokinet\\lokinet.ini");
argv[2] = nullptr;
lokinet_main(argc, argv);
}

@ -1,4 +1,5 @@
#pragma once
#include "platform.hpp"
#include <llarp/util/fs.hpp>
@ -21,20 +22,22 @@ namespace llarp
inline fs::path
GetDefaultDataDir()
{
#ifdef _WIN32
return "C:/programdata/lokinet";
#else
fs::path datadir{"/var/lib/lokinet"};
if (auto uid = ::geteuid())
if constexpr (not platform::is_windows)
{
if (auto* pw = getpwuid(uid))
fs::path datadir{"/var/lib/lokinet"};
#ifndef _WIN32
if (auto uid = geteuid())
{
datadir = fs::path{pw->pw_dir} / ".lokinet";
if (auto* pw = getpwuid(uid))
{
datadir = fs::path{pw->pw_dir} / ".lokinet";
}
}
}
return datadir;
#endif
return datadir;
}
else
return "C:\\ProgramData\\Lokinet";
}
inline fs::path

@ -1,6 +1,5 @@
#pragma once
#include "platform.hpp"
#include "null_platform.hpp"
#include <llarp/constants/platform.hpp>
#include <type_traits>

@ -1,6 +1,5 @@
#pragma once
#include "platform.hpp"
#include "null_platform.hpp"
#include <llarp/constants/platform.hpp>
#include <type_traits>

@ -223,7 +223,6 @@ namespace llarp
return nullptr;
}
protected:
// Triggers an event loop wakeup; use when something has been done that requires the event loop
// to wake up (e.g. adding to queues). This is called implicitly by call() and call_soon().
// Idempotent and thread-safe.

@ -66,6 +66,8 @@ namespace llarp::win32
HANDLE m_Handle;
std::thread m_Runner;
thread::Queue<WD_Packet> m_RecvQueue;
// dns packet queue size
static constexpr size_t recv_queue_size = 64;
public:
WinDivert_IO(
@ -132,7 +134,7 @@ namespace llarp::win32
virtual net::IPPacket
ReadNextPacket() override
{
auto w_pkt = recv_packet();
auto w_pkt = m_RecvQueue.tryPopFront();
if (not w_pkt)
return net::IPPacket{};
net::IPPacket pkt{std::move(w_pkt->pkt)};
@ -150,17 +152,21 @@ namespace llarp::win32
throw std::runtime_error{"windivert thread is already running"};
auto read_loop = [this]() {
log::debug(cat, "windivert read loop start");
log::info(cat, "windivert read loop start");
while (true)
{
// in the read loop, read packets until they stop coming in
// each packet is sent off
if (auto maybe_pkt = recv_packet())
{
m_RecvQueue.pushBack(std::move(*maybe_pkt));
// wake up event loop
m_Wake();
}
else // leave loop on read fail
break;
}
log::debug(cat, "windivert read loop end");
log::info(cat, "windivert read loop end");
};
m_Runner = std::thread{std::move(read_loop)};

Loading…
Cancel
Save