Skip to content

Commit

Permalink
fix 'closed' while downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauumm committed Jan 5, 2024
1 parent d23c5cb commit f593719
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 2 additions & 0 deletions extlibs/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,8 @@ function HTTP:connectCoroutine(client, server)

self:handleClient(client)
self:log(1, "closing client...")
client:shutdown("send")
self:receive(client, 1)
client:close()
self.clients:removeObject(client)
self:log(2, "# clients remaining: " .. #self.clients)
Expand Down
7 changes: 0 additions & 7 deletions ui/overlay/packs/download.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ xpcall(function()
local http = require("socket.http")
local url = require("socket.url")

local oldopen = http.open
http.open = function(host, port, create)
local h = oldopen(host, port, create)
assert(h.c:setoption("tcp-nodelay", true))
return h
end

local filename = string.format("%s%s_%s.zip", tmp_folder, version, pack_name)
local file = love.filesystem.openFile(filename, "w")
local download_size, last_progress = 0, nil
Expand Down

0 comments on commit f593719

Please sign in to comment.