From a983fbdad590a1905ced5ee75034b2bac9a853ad Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 13 Jan 2010 01:46:05 +0000 Subject: fixed packet length --- src/anytun.cpp | 2 -- src/datatypes.h | 2 ++ src/packetSource.cpp | 5 +---- 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::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::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(it->sock_->receive_from(boost::asio::buffer(it->buf_, it->len_), result.remote_)); { Lock lock(thread_result_mutex_); -- cgit v1.2.3