summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2010-01-13 01:46:05 +0000
committerChristian Pointner <equinox@anytun.org>2010-01-13 01:46:05 +0000
commita983fbdad590a1905ced5ee75034b2bac9a853ad (patch)
tree669d253da4c7509d70884b508b2d0e83069969b4
parentsingle thread per socket (diff)
fixed packet length
-rw-r--r--src/anytun.cpp2
-rw-r--r--src/datatypes.h2
-rw-r--r--src/packetSource.cpp5
3 files changed, 3 insertions, 6 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index 85c85bf..51c2b1d 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -72,8 +72,6 @@
#include "syncOnConnect.hpp"
#endif
-#define MAX_PACKET_LENGTH 1600
-
#include "cryptinit.hpp"
#include "daemon.hpp"
#include "sysExec.h"
diff --git a/src/datatypes.h b/src/datatypes.h
index 4e5977d..ba34614 100644
--- a/src/datatypes.h
+++ b/src/datatypes.h
@@ -65,4 +65,6 @@ typedef int system_error_t;
typedef DWORD system_error_t;
#endif
+#define MAX_PACKET_LENGTH 1600
+
#endif
diff --git a/src/packetSource.cpp b/src/packetSource.cpp
index 9eaedc6..fa4abd0 100644
--- a/src/packetSource.cpp
+++ b/src/packetSource.cpp
@@ -94,7 +94,7 @@ void UDPPacketSource::onResolve(PacketSourceResolverIt& it)
if(sockets_.size() > 1) {
std::list<sockets_element_t>::iterator it = sockets_.begin();
for(;it != sockets_.end(); ++it) {
- it->len_ = 1600; // TODO packet size
+ it->len_ = MAX_PACKET_LENGTH;
it->buf_ = new u_int8_t[it->len_];
if(!it->buf_)
AnytunError::throwErr() << "memory error";
@@ -127,9 +127,6 @@ void UDPPacketSource::recv_thread(std::list<sockets_element_t>::iterator it)
result.it_ = it;
for(;;) {
it->sem_->down();
-
- cLog.msg(Log::PRIO_DEBUG) << "calling recv() for " << it->sock_->local_endpoint();
-
result.len_ = static_cast<u_int32_t>(it->sock_->receive_from(boost::asio::buffer(it->buf_, it->len_), result.remote_));
{
Lock lock(thread_result_mutex_);