From e866243097c767d040a24daf5af881d73ed26a6d Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 11 Aug 2014 18:33:01 -0400 Subject: [PATCH] send buffer offset --- HTTPServer.cpp | 4 ++-- Streaming.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index c1f4f55a..b990614a 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -545,9 +545,9 @@ namespace util { std::string content (""); content += "" + HTTPConnection::itoopieImage + ""; - std::string response ("HTTP/1.0 200 OK\r\n\r\n"); + std::string response ("HTTP/1.0 200 OK\r\n"); response += "Content-Length: " + boost::lexical_cast(content.length()) + "\r\n"; - response += "Content-Type: text/html\r\n"; + response += "Content-Type: text/html\r\n\r\n"; response += content; m_Stream->Send ((uint8_t *)response.c_str (), response.length (), 30); m_Stream->Close (); diff --git a/Streaming.cpp b/Streaming.cpp index d6a31886..ad448820 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -243,6 +243,7 @@ namespace stream size_t sentLen = STREAMING_MTU - size; if (len < sentLen) sentLen = len; memcpy (packet + size, buf, sentLen); + buf += sentLen; len -= sentLen; size += sentLen; // payload m_LocalDestination->Sign (packet, size, signature); @@ -257,6 +258,7 @@ namespace stream size_t sentLen = STREAMING_MTU - size; if (len < sentLen) sentLen = len; memcpy (packet + size, buf, sentLen); + buf += sentLen; len -= sentLen; size += sentLen; // payload }