From d7a5235d9a3702cdbe2fd67d5aac7368d2484a87 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Thu, 11 Dec 2008 14:47:08 +0000 Subject: mainly type and define fixes partly builds on windows without conversion between host and network byte order working compile defines: NOCRYPT;NODAEMON;NOEXEC;NOPACKED;NOSYSLOG;NOSIGNALCONTROLLER;WIN32_LEAN_AND_MEAN --- src/anytun.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/anytun.cpp') diff --git a/src/anytun.cpp b/src/anytun.cpp index 05d2164..ba1a6ab 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -84,7 +84,7 @@ #define SESSION_KEYLEN_ENCR 16 // TODO: hardcoded size #define SESSION_KEYLEN_SALT 14 // TODO: hardcoded size -void createConnection(const PacketSourceEndpoint & remote_end, ConnectionList & cl, u_int16_t seqSize, SyncQueue & queue, mux_t mux) +void createConnection(const PacketSourceEndpoint & remote_end, ConnectionList & cl, window_size_t seqSize, SyncQueue & queue, mux_t mux) { SeqWindow * seq= new SeqWindow(seqSize); seq_nr_t seq_nr_=0; @@ -414,13 +414,13 @@ int main(int argc, char* argv[]) daemonize(); daemonized = true; } -#endif if(pidFile.is_open()) { pid_t pid = getpid(); pidFile << pid; pidFile.close(); } +#endif #ifndef NOSIGNALCONTROLLER SignalController sig; @@ -436,7 +436,9 @@ int main(int argc, char* argv[]) #endif boost::thread senderThread(boost::bind(sender,&p)); +#ifndef NOSIGNALCONTROLLER boost::thread receiverThread(boost::bind(receiver,&p)); +#endif #ifndef ANYTUN_NOSYNC boost::thread * syncListenerThread; if(gOpt.getLocalSyncPort() != "") @@ -448,10 +450,13 @@ int main(int argc, char* argv[]) connectThreads.push_back(new boost::thread(boost::bind(syncConnector,point))); } #endif - - int ret = sig.run(); - + +#ifndef NOSIGNALCONTROLLER + int ret = sig.run(); return ret; +#else + receiver(&p); +#endif // TODO cleanup here! /* pthread_cancel(senderThread); -- cgit v1.2.3