Fix: Windows handle error on disconnect.

This commit is contained in:
cheatfate 2018-07-03 08:35:45 +03:00
parent 50a91cef9f
commit aa15313aa8
1 changed files with 5 additions and 2 deletions

View File

@ -312,10 +312,13 @@ when defined(windows):
transp.state.incl(ReadPaused) transp.state.incl(ReadPaused)
elif int(err) == ERROR_OPERATION_ABORTED: elif int(err) == ERROR_OPERATION_ABORTED:
# CancelIO() interrupt # CancelIO() interrupt
discard transp.state.incl(ReadPaused)
elif int(err) == ERROR_NETNAME_DELETED:
transp.state.incl({ReadEof, ReadPaused})
else: else:
transp.setReadError(err) transp.setReadError(err)
if not isNil(transp.reader): if not isNil(transp.reader):
if not transp.reader.finished:
transp.finishReader() transp.finishReader()
if ReadPaused in transp.state: if ReadPaused in transp.state:
# Transport buffer is full, so we will not continue on reading. # Transport buffer is full, so we will not continue on reading.