From ce92b629f1ddc5691ac2a22b3469ca4e7c7491de Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 29 Mar 2014 20:14:57 -0400 Subject: [PATCH 1/3] fixed build error --- HTTPServer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HTTPServer.h b/HTTPServer.h index dca004b0..4968c2f4 100644 --- a/HTTPServer.h +++ b/HTTPServer.h @@ -11,10 +11,11 @@ namespace i2p { namespace util { + const std::string itoopieImage = "\"\""; + class HTTPConnection { - const std::string itoopieImage = "\"\""; - + protected: struct header { From 3acdbf38c903215f12bfc726d89887f245c28106 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 30 Mar 2014 08:40:53 -0400 Subject: [PATCH 2/3] moved itoopieImage inside HTTPConnection --- HTTPServer.cpp | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++ HTTPServer.h | 9 +++-- 2 files changed, 103 insertions(+), 3 deletions(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index b7a2989a..27e6f0a1 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -13,6 +13,103 @@ namespace i2p { namespace util { + + const std::string HTTPConnection::itoopieImage = + "\"\""; + namespace misc_strings { diff --git a/HTTPServer.h b/HTTPServer.h index 4968c2f4..df9ca4e7 100644 --- a/HTTPServer.h +++ b/HTTPServer.h @@ -11,12 +11,10 @@ namespace i2p { namespace util { - const std::string itoopieImage = "\"\""; - class HTTPConnection { - protected: + struct header { std::string name; @@ -70,8 +68,13 @@ namespace util reply m_Reply; protected: + virtual void HandleDestinationRequest(const std::string& address, const std::string& uri); virtual void RunRequest (); + + private: + + static const std::string itoopieImage; }; class HTTPServer From 5ed34cc52a87813e9ea92baf41c3f800dc76909e Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 30 Mar 2014 09:02:43 -0400 Subject: [PATCH 3/3] fixed race condition --- Streaming.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Streaming.cpp b/Streaming.cpp index bf8eacd3..facf68b4 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -60,7 +60,8 @@ namespace stream } // send ack for last message - SendQuickAck (); + if (m_IsOpen) + SendQuickAck (); } else { @@ -127,9 +128,9 @@ namespace stream if (flags & PACKET_FLAG_CLOSE) { LogPrint ("Closed"); + SendQuickAck (); // send ack for close explicitly? m_IsOpen = false; m_ReceiveQueue.WakeUp (); - m_ReceiveTimer.cancel (); } }