|
|
@ -452,12 +452,14 @@ namespace stream |
|
|
|
LogPrint (eLogInfo, "Trying to send stream data before closing"); |
|
|
|
LogPrint (eLogInfo, "Trying to send stream data before closing"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case eStreamStatusReset: |
|
|
|
case eStreamStatusReset: |
|
|
|
|
|
|
|
SendClose (); |
|
|
|
Terminate (); |
|
|
|
Terminate (); |
|
|
|
m_LocalDestination.DeleteStream (shared_from_this ()); |
|
|
|
m_LocalDestination.DeleteStream (shared_from_this ()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case eStreamStatusClosing: |
|
|
|
case eStreamStatusClosing: |
|
|
|
if (m_SentPackets.empty () && m_SendBuffer.eof ()) // nothing to send
|
|
|
|
if (m_SentPackets.empty () && m_SendBuffer.eof ()) // nothing to send
|
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
m_Status = eStreamStatusClosed; |
|
|
|
SendClose (); |
|
|
|
SendClose (); |
|
|
|
Terminate (); |
|
|
|
Terminate (); |
|
|
|
m_LocalDestination.DeleteStream (shared_from_this ()); |
|
|
|
m_LocalDestination.DeleteStream (shared_from_this ()); |
|
|
@ -475,7 +477,6 @@ namespace stream |
|
|
|
|
|
|
|
|
|
|
|
void Stream::SendClose () |
|
|
|
void Stream::SendClose () |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_Status = eStreamStatusClosed; |
|
|
|
|
|
|
|
Packet * p = new Packet (); |
|
|
|
Packet * p = new Packet (); |
|
|
|
uint8_t * packet = p->GetBuffer (); |
|
|
|
uint8_t * packet = p->GetBuffer (); |
|
|
|
size_t size = 0; |
|
|
|
size_t size = 0; |
|
|
|