mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
Do not resume the fd after closing, see #1408
This commit is contained in:
@@ -28,7 +28,7 @@ local function wakeup(s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function pause_socket(s, size)
|
local function pause_socket(s, size)
|
||||||
if s.pause then
|
if s.pause ~= nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if size then
|
if size then
|
||||||
@@ -254,7 +254,7 @@ end
|
|||||||
|
|
||||||
function socket.pause(id)
|
function socket.pause(id)
|
||||||
local s = socket_pool[id]
|
local s = socket_pool[id]
|
||||||
if s == nil or s.pause then
|
if s == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pause_socket(s)
|
pause_socket(s)
|
||||||
@@ -280,6 +280,7 @@ function socket.close(id)
|
|||||||
end
|
end
|
||||||
driver.close(id)
|
driver.close(id)
|
||||||
if s.connected then
|
if s.connected then
|
||||||
|
s.pause = false -- Do not resume this fd if it paused.
|
||||||
if s.co then
|
if s.co then
|
||||||
-- reading this socket on another coroutine, so don't shutdown (clear the buffer) immediately
|
-- reading this socket on another coroutine, so don't shutdown (clear the buffer) immediately
|
||||||
-- wait reading coroutine read the buffer.
|
-- wait reading coroutine read the buffer.
|
||||||
|
|||||||
Reference in New Issue
Block a user