fix halfclose bug, See detail #1358

This commit is contained in:
Cloud Wu
2021-03-09 17:45:03 +08:00
parent 0d9bfcb721
commit 600a64327e
2 changed files with 5 additions and 4 deletions

View File

@@ -269,8 +269,8 @@ function socket.close(id)
if s == nil then
return
end
driver.close(id)
if s.connected then
driver.close(id)
if s.co then
-- reading this socket on another coroutine, so don't shutdown (clear the buffer) immediately
-- wait reading coroutine read the buffer.