Merge remote-tracking branch 'github/master' into dev

pull/67/head
Jeff Becker 6 years ago
commit 3718a7d016
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -54,9 +54,10 @@ if(STATIC_LINK)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc -static" )
endif()
if(DNS_PORT)
add_definitions(-DDNS_PORT=${DNS_PORT})
endif()
# This is now configurable in ini
#if(DNS_PORT)
# add_definitions(-DDNS_PORT=${DNS_PORT})
#endif()
if(SHADOW)
set(WITH_STATIC OFF)

@ -64,8 +64,6 @@ EXE = $(BUILD_ROOT)/lokinet
TEST_EXE = $(BUILD_ROOT)/testAll
ABYSS_EXE = $(BUILD_ROOT)/abyss-main
DNS_PORT ?= 53
# PROCS ?= $(shell cat /proc/cpuinfo | grep processor | wc -l)
@ -82,7 +80,7 @@ clean:
debug-configure:
mkdir -p '$(BUILD_ROOT)'
$(CONFIG_CMD) -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) -DDNS_PORT=$(DNS_PORT) -DCMAKE_ASM_FLAGS='$(ASFLAGS)' -DCMAKE_C_FLAGS='$(CFLAGS)' -DCMAKE_CXX_FLAGS='$(CXXFLAGS)'
$(CONFIG_CMD) -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) -DCMAKE_ASM_FLAGS='$(ASFLAGS)' -DCMAKE_C_FLAGS='$(CFLAGS)' -DCMAKE_CXX_FLAGS='$(CXXFLAGS)'
release-configure: clean
mkdir -p '$(BUILD_ROOT)'
@ -160,12 +158,12 @@ android-gradle-prepare:
android-gradle: android-gradle-prepare
cd $(ANDROID_DIR) && JAVA_HOME=$(JAVA_HOME) $(GRADLE) clean assemble
android: android-gradle
windows-configure: clean
mkdir -p '$(BUILD_ROOT)'
$(CONFIG_CMD) -DCMAKE_CROSSCOMPILING=ON -DCMAKE_TOOLCHAIN_FILE='$(REPO)/contrib/cross/mingw.cmake' -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc-win32 -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++-win32 -DDNS_PORT=$(DNS_PORT) -DCMAKE_ASM_FLAGS='$(ASFLAGS)' -DCMAKE_C_FLAGS='$(CFLAGS)' -DCMAKE_CXX_FLAGS='$(CXXFLAGS)'
$(CONFIG_CMD) -DCMAKE_CROSSCOMPILING=ON -DCMAKE_TOOLCHAIN_FILE='$(REPO)/contrib/cross/mingw.cmake' -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc-win32 -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++-win32 -DCMAKE_ASM_FLAGS='$(ASFLAGS)' -DCMAKE_C_FLAGS='$(CFLAGS)' -DCMAKE_CXX_FLAGS='$(CXXFLAGS)'
windows: windows-configure
$(MAKE) -C '$(BUILD_ROOT)'

@ -162,7 +162,14 @@ llarp_generic_ensure_config(std::ofstream &f, std::string basepath)
f << "upstream=" << DEFAULT_RESOLVER_EU << std::endl;
f << "# opennic au resolver" << std::endl;
f << "upstream=" << DEFAULT_RESOLVER_AU << std::endl;
// Make auto-config smarter
// will this break reproducibility rules?
#ifdef __linux__
f << "bind=127.3.2.1:53" << std::endl;
#else
f << "bind=127.0.0.1:53" << std::endl;
#endif
f << std::endl << std::endl;
f << "# network database settings block " << std::endl;
@ -246,6 +253,8 @@ llarp_ensure_client_config(std::ofstream &f, std::string basepath)
f << "# network settings " << std::endl;
f << "[network]" << std::endl;
f << "profiles=" << basepath << "profiles.dat" << std::endl;
// WHAT? Why this ifndef?
#ifndef __linux__
f << "# ";
#endif

@ -9,10 +9,6 @@
#include <netdb.h>
#endif
#ifndef DNS_PORT
#define DNS_PORT (53)
#endif
namespace llarp
{
namespace handlers
@ -55,7 +51,7 @@ namespace llarp
if(k == "local-dns")
{
std::string resolverAddr = v;
uint16_t dnsport = DNS_PORT;
uint16_t dnsport = 53;
auto pos = v.find(":");
if(pos != std::string::npos)
{
@ -68,7 +64,7 @@ namespace llarp
if(k == "upstream-dns")
{
std::string resolverAddr = v;
uint16_t dnsport = DNS_PORT;
uint16_t dnsport = 53;
auto pos = v.find(":");
if(pos != std::string::npos)
{

@ -30,12 +30,12 @@ namespace llarp
QueueManager m_manager;
std::atomic_uint32_t m_waitingPoppers;
std::atomic<std::uint32_t> m_waitingPoppers;
util::Semaphore m_popSemaphore;
const char
m_popSemaphorePadding[(2u * Alignment) - sizeof(util::Semaphore)];
std::atomic_uint32_t m_waitingPushers;
std::atomic<std::uint32_t> m_waitingPushers;
util::Semaphore m_pushSemaphore;
const char
m_pushSemaphorePadding[(2u * Alignment) - sizeof(util::Semaphore)];

@ -159,7 +159,7 @@ namespace llarp
(void)m_pushPadding;
(void)m_popPadding;
m_states = new std::atomic_uint32_t[capacity];
m_states = new std::atomic<std::uint32_t>[capacity];
for(size_t i = 0; i < capacity; ++i)
{

@ -70,7 +70,7 @@ namespace llarp
public:
static constexpr size_t Alignment = 64;
using AtomicIndex = std::atomic_uint32_t;
using AtomicIndex = std::atomic<std::uint32_t>;
private:
AtomicIndex m_pushIndex; // Index in the buffer that the next
@ -90,7 +90,7 @@ namespace llarp
const uint32_t m_maxCombinedIndex; // Maximum combined value of index and
// generation for this object.
std::atomic_uint32_t* m_states; // Array of index states.
std::atomic<std::uint32_t>* m_states; // Array of index states.
AtomicIndex&
pushIndex();

Loading…
Cancel
Save