Browse Source

fixed vtable discrepency

pull/1/head
Joseph Henry 9 years ago
parent
commit
905a822b05
  1. 2
      make-linux.mk
  2. 4
      make-mac.mk
  3. 33
      src/service.cpp
  4. 9
      zerotierone/service/OneService.cpp
  5. 10
      zerotierone/service/OneService.hpp

2
make-linux.mk

@ -27,7 +27,7 @@ INCLUDES=
DEFS=
ARCH_FLAGS=-arch x86_64
CFLAGS=
CXXFLAGS=$(CFLAGS) -fno-rtti -std=c++11
CXXFLAGS=$(CFLAGS) -fno-rtti -std=c++11 -DZT_SDK
include objects.mk

4
make-mac.mk

@ -27,7 +27,7 @@ INCLUDES=
DEFS=
ARCH_FLAGS=-arch x86_64
CFLAGS=
CXXFLAGS=$(CFLAGS) -fno-rtti -std=c++11
CXXFLAGS=$(CFLAGS) -fno-rtti -std=c++11 -DZT_SDK
include objects.mk
@ -254,7 +254,7 @@ osx_static_lib: lwip $(OBJS)
else
osx_static_lib: pico $(OBJS)
$(CXX) $(CXXFLAGS) $(STACK_FLAGS) $(DEFS) $(INCLUDES) $(ZTFLAGS) -DSDK_SERVICE -DSDK -DSDK_BUNDLED $(PICO_DRIVER_FILES) $(SDK_INTERCEPT_C_FILES) $(SDK_SERVICE_CPP_FILES) src/service.cpp -c
libtool -static -o build/libzt.a picotcp.o proxy.o tap.o one.o OneService.o service.o sockets.o rpc.o intercept.o OneService.o $(OBJS)
libtool -static -o build/libzt.a picotcp.o proxy.o tap.o one.o OneService.o service.o sockets.o rpc.o intercept.o $(OBJS)
endif
# Builds zts_* library tests

33
src/service.cpp

@ -51,23 +51,23 @@
#include "debug.h"
#include "build.h"
std::string service_path;
pthread_t intercept_thread;
int * intercept_thread_id;
pthread_key_t thr_id_key;
static ZeroTier::OneService *volatile zt1Service;
#ifdef __cplusplus
extern "C" {
#endif
static ZeroTier::OneService *zt1Service;
std::string service_path;
std::string localHomeDir; // Local shortened path
std::string givenHomeDir; // What the user/application provides as a suggestion
std::string homeDir; // The resultant platform-specific dir we *must* use internally
std::string homeDir; // The resultant platform-specific dir we *must* use internally
std::string netDir;
std::string rpcNWID;
bool rpcEnabled;
pthread_t intercept_thread;
pthread_key_t thr_id_key;
#ifdef __cplusplus
extern "C" {
#endif
int * intercept_thread_id;
// ------------------------------------------------------------------------------
// --------------------------------- Base zts_* API -----------------------------
@ -289,7 +289,6 @@ void zts_start_service(const char *path)
}
//void init_service_and_rpc(int key, const char * path, const char * nwid) {
// rpcEnabled = true;
// rpcNWID = nwid;
// init_service(key, path);
//}
@ -505,17 +504,7 @@ void *zts_start_core_service(void *thread_id) {
return NULL;
}
//chdir(current_dir); // Return to previous current working directory (at the request of Unity3D)
#if defined(__UNITY_3D__)
DEBUG_INFO("starting service...");
#endif
DEBUG_INFO("starting service...");
// Initialize RPC
// TODO: remove?
if(rpcEnabled) {
zts_init_rpc(localHomeDir.c_str(), rpcNWID.c_str());
}
DEBUG_INFO("starting service...");
// Generate random port for new service instance
unsigned int randp = 0;

9
zerotierone/service/OneService.cpp

@ -876,16 +876,15 @@ public:
}
#ifdef ZT_SDK
virtual void leave(const char *hp)
{
_node->leave(Utils::hexStrToU64(hp),NULL);
}
virtual void join(const char *hp)
{
_node->join(Utils::hexStrToU64(hp),NULL);
}
virtual void leave(const char *hp)
{
_node->leave(Utils::hexStrToU64(hp),NULL);
}
virtual std::string givenHomePath()
{

10
zerotierone/service/OneService.hpp

@ -152,15 +152,15 @@ public:
#ifdef ZT_SDK
/**
* Joins a network
*/
virtual void join(const char *hp) = 0;
/**
* Leaves a network
*/
virtual void leave(const char *hp) = 0;
/**
* Joins a network
*/
virtual void join(const char *hp) = 0;
/**
* Returns the homePath given by the client application
* - Used for SDK mode

Loading…
Cancel
Save