|
|
|
@ -222,9 +222,9 @@ namespace stream
@@ -222,9 +222,9 @@ namespace stream
|
|
|
|
|
|
|
|
|
|
m_LastReceivedSequenceNumber = receivedSeqn; |
|
|
|
|
|
|
|
|
|
if (flags & PACKET_FLAG_CLOSE) |
|
|
|
|
if (flags & (PACKET_FLAG_CLOSE | PACKET_FLAG_RESET)) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogInfo, "Closed"); |
|
|
|
|
LogPrint (eLogInfo, (flags & PACKET_FLAG_RESET) ? "Reset" : "Closed"); |
|
|
|
|
m_Status = eStreamStatusReset; |
|
|
|
|
Close (); |
|
|
|
|
} |
|
|
|
@ -486,7 +486,7 @@ namespace stream
@@ -486,7 +486,7 @@ namespace stream
|
|
|
|
|
LogPrint (eLogInfo, "Trying to send stream data before closing"); |
|
|
|
|
break; |
|
|
|
|
case eStreamStatusReset: |
|
|
|
|
SendClose (); |
|
|
|
|
SendClose (true); // send reset
|
|
|
|
|
Terminate (); |
|
|
|
|
m_LocalDestination.DeleteStream (shared_from_this ()); |
|
|
|
|
break; |
|
|
|
@ -509,7 +509,7 @@ namespace stream
@@ -509,7 +509,7 @@ namespace stream
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Stream::SendClose () |
|
|
|
|
void Stream::SendClose (bool reset) |
|
|
|
|
{ |
|
|
|
|
Packet * p = new Packet (); |
|
|
|
|
uint8_t * packet = p->GetBuffer (); |
|
|
|
@ -525,7 +525,7 @@ namespace stream
@@ -525,7 +525,7 @@ namespace stream
|
|
|
|
|
packet[size] = 0; |
|
|
|
|
size++; // NACK count
|
|
|
|
|
size++; // resend delay
|
|
|
|
|
htobe16buf (packet + size, PACKET_FLAG_CLOSE | PACKET_FLAG_SIGNATURE_INCLUDED); |
|
|
|
|
htobe16buf (packet + size, (reset ? PACKET_FLAG_RESET : PACKET_FLAG_CLOSE) | PACKET_FLAG_SIGNATURE_INCLUDED); |
|
|
|
|
size += 2; // flags
|
|
|
|
|
size_t signatureLen = m_LocalDestination.GetOwner ().GetIdentity ().GetSignatureLen (); |
|
|
|
|
htobe16buf (packet + size, signatureLen); // signature only
|
|
|
|
|