summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--anytun.cpp4
-rw-r--r--syncClientSocket.cpp10
-rw-r--r--syncQueue.cpp5
3 files changed, 5 insertions, 14 deletions
diff --git a/anytun.cpp b/anytun.cpp
index 2056f02..ebff073 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -360,12 +360,8 @@ int main(int argc, char* argv[])
ConnectToList connect_to = opt.getConnectTo();
SyncQueue queue;
- cLog.msg(Log::PRIO_DEBUG) << "pre create conn";
-
if(opt.getRemoteAddr() != "")
createConnection(opt.getRemoteAddr(),opt.getRemotePort(),cl,opt.getSeqWindowSize(), queue);
-
- cLog.msg(Log::PRIO_DEBUG) << "post create conn";
ThreadParam p(opt, dev, *src, cl, queue,*(new OptionConnectTo()));
diff --git a/syncClientSocket.cpp b/syncClientSocket.cpp
index 1403ed4..76fd40d 100644
--- a/syncClientSocket.cpp
+++ b/syncClientSocket.cpp
@@ -6,11 +6,12 @@
#include <boost/archive/text_iarchive.hpp>
+#include "log.h"
//#include "connectionParam.h"
#include "Sockets/Utility.h"
#include "syncClientSocket.h"
#include "buffer.h"
-//#include "log.h"
+
SyncClientSocket::SyncClientSocket(ISocketHandler& h,ConnectionList & cl)
:TcpSocket(h),cl_(cl)
@@ -26,14 +27,13 @@ SyncClientSocket::SyncClientSocket(ISocketHandler& h,ConnectionList & cl)
bool SyncClientSocket::OnConnectRetry()
{
- std::cout << "SyncClientSocket::OnConnectRetry" << std::endl;
return true;
}
void SyncClientSocket::OnReconnect()
{
- std::cout << "SyncClientSocket::OnReconnect" << std::endl;
+ cLog.msg(Log::PRIO_NOTICE) << "reconnected with " << GetRemoteHostname() << std::endl;
// ...
//Send("Welcome back\r\n");
}
@@ -43,7 +43,7 @@ void SyncClientSocket::OnRawData(const char *buf,size_t len)
//void SyncClientSocket::OnLine(const std::string& line)
{
std::stringstream iss;
- std::cout << "recieved sync inforamtaion:"<< std::endl;
+ cLog.msg(Log::PRIO_NOTICE) << "recieved sync inforamtaion from " << GetRemoteHostname() << std::endl;
for(size_t index=0;index<len;index++)
{
std::cout << buf[index];
@@ -55,7 +55,7 @@ void SyncClientSocket::OnRawData(const char *buf,size_t len)
ia >> scom;
u_int16_t mux = scom.getMux();
const ConnectionParam & conn = cl_.getConnection(mux)->second;
- std::cout << "sync connection #"<<mux<<" remote host " << conn.remote_host_ << ":" << conn.remote_port_ << std::endl;
+ cLog.msg(Log::PRIO_NOTICE) << "sync connection #"<<mux<<" remote host " << conn.remote_host_ << ":" << conn.remote_port_ << std::endl;
}
//void StatusClientSocket::InitSSLServer()
diff --git a/syncQueue.cpp b/syncQueue.cpp
index 81c8a0e..7d3c35f 100644
--- a/syncQueue.cpp
+++ b/syncQueue.cpp
@@ -42,15 +42,10 @@
#include "syncQueue.h"
void SyncQueue::push(const SyncCommand & scom )
{
-
- std::cout << "entered push" << std::endl;
-
std::ostringstream sout;
boost::archive::text_oarchive oa(sout);
oa << scom;
- std::cout << "after serialize" << std::endl;
-
Lock lock(mutex_);
queue_.push(sout.str());
}