SecioConn.readMessage(): fix the exception types
This commit is contained in:
parent
5285f0d091
commit
7f8090b166
|
@ -195,9 +195,9 @@ method readMessage(sconn: SecioConn): Future[seq[byte]] {.async.} =
|
||||||
else:
|
else:
|
||||||
trace "Received message header size is more then allowed",
|
trace "Received message header size is more then allowed",
|
||||||
length = length, allowed_length = SecioMaxMessageSize
|
length = length, allowed_length = SecioMaxMessageSize
|
||||||
except AsyncStreamIncompleteError:
|
except LPStreamIncompleteError:
|
||||||
trace "Connection dropped while reading"
|
trace "Connection dropped while reading"
|
||||||
except AsyncStreamReadError:
|
except LPStreamReadError:
|
||||||
trace "Error reading from connection"
|
trace "Error reading from connection"
|
||||||
|
|
||||||
method writeMessage(sconn: SecioConn, message: seq[byte]) {.async.} =
|
method writeMessage(sconn: SecioConn, message: seq[byte]) {.async.} =
|
||||||
|
|
|
@ -465,7 +465,7 @@ suite "BufferStream":
|
||||||
waitFor(pipeTest()) == true
|
waitFor(pipeTest()) == true
|
||||||
|
|
||||||
test "shouldn't get stuck on close":
|
test "shouldn't get stuck on close":
|
||||||
proc test(): Future[bool] {.async.} =
|
proc closeTest(): Future[bool] {.async.} =
|
||||||
proc createMessage(tmplate: string, size: int): seq[byte] =
|
proc createMessage(tmplate: string, size: int): seq[byte] =
|
||||||
result = newSeq[byte](size)
|
result = newSeq[byte](size)
|
||||||
for i in 0 ..< len(result):
|
for i in 0 ..< len(result):
|
||||||
|
@ -482,4 +482,5 @@ suite "BufferStream":
|
||||||
result = false
|
result = false
|
||||||
|
|
||||||
check:
|
check:
|
||||||
waitFor(test()) == true
|
waitFor(closeTest()) == true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue