fix: if stream is not available in open state, raise exception (#82)

This commit is contained in:
richΛrd
2025-05-29 09:59:27 -04:00
committed by GitHub
parent b5d3f7cc6d
commit ca3eda53be
2 changed files with 3 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
packageName = "quic"
version = "0.2.6"
version = "0.2.7"
author = "Status Research & Development GmbH"
description = "QUIC protocol implementation"
license = "MIT"

View File

@@ -44,7 +44,8 @@ method read*(state: OpenStream): Future[seq[byte]] {.async.} =
else:
incomingFut.cancelSoon()
let stream = state.stream.valueOr:
return
raise newException(StreamError, "stream is closed")
if state.frameSorter.isEOF():
stream.switch(newClosedStream(state.incoming, state.frameSorter))