diff --git a/lualib/http/httpc.lua b/lualib/http/httpc.lua index 79e7db74..615d6017 100644 --- a/lualib/http/httpc.lua +++ b/lualib/http/httpc.lua @@ -106,7 +106,7 @@ function httpc.request(method, host, url, recvheader, header, content) if not finish then local temp = fd fd = nil - socket.close(temp) + socket.shutdown(temp) end end) end diff --git a/lualib/http/sockethelper.lua b/lualib/http/sockethelper.lua index f5d6ae80..10b32346 100644 --- a/lualib/http/sockethelper.lua +++ b/lualib/http/sockethelper.lua @@ -102,4 +102,8 @@ function sockethelper.close(fd) socket.close(fd) end +function sockethelper.shutdown(fd) + socket.shutdown(fd) +end + return sockethelper