Browse Source

send FIN if closed by peer

pull/163/head
orignal 10 years ago
parent
commit
d13b4f6698
  1. 3
      Streaming.cpp

3
Streaming.cpp

@ -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;

Loading…
Cancel
Save