From 1ea26a113ad87424465af1d4a5d22013f9b782f9 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 6 Aug 2014 16:00:34 -0400 Subject: [PATCH] send FIN in streaming thread --- Streaming.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Streaming.cpp b/Streaming.cpp index c75464f6..07f1a72a 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -255,7 +255,8 @@ namespace stream if (m_IsOpen) { m_IsOpen = false; - uint8_t packet[MAX_PACKET_SIZE]; + Packet * p = new Packet (); + uint8_t * packet = p->GetBuffer (); size_t size = 0; *(uint32_t *)(packet + size) = htobe32 (m_SendStreamID); size += 4; // sendStreamID @@ -277,8 +278,9 @@ namespace stream size += 40; // signature m_LocalDestination->Sign (packet, size, signature); - if (SendPacket (packet, size)) - LogPrint ("FIN sent"); + p->len = size; + m_Service.post (boost::bind (&Stream::SendPacket, this, p)); + LogPrint ("FIN sent"); } }