mirror of
https://github.com/vacp2p/nim-quic.git
synced 2026-01-08 21:38:05 -05:00
fix: if stream is not available in open state, raise exception (#82)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user