tor-proto: Update the stream map if we get an END message.

This handles the previously not handled `message_closes_stream == true`
case.
This commit is contained in:
Gabriela Moldovan 2023-08-01 15:26:10 +01:00
parent 907d8cf255
commit 4edff7e670
No known key found for this signature in database
GPG Key ID: 3946E0ADE72BAC99
1 changed files with 5 additions and 1 deletions

View File

@ -1705,7 +1705,11 @@ impl Reactor {
.get_mut(Into::<usize>::into(hop_num))
.ok_or(Error::CircuitClosed)?;
if !message_closes_stream {
if message_closes_stream {
hop.map.ending_msg_received(stream_id)?;
return Ok(());
} else {
let begin = msg
.decode::<Begin>()
.map_err(|e| Error::from_bytes_err(e, "Invalid Begin message"))?