Actually actually fix wget?

This commit is contained in:
20kdc 2018-04-25 19:12:45 +01:00
parent 6be34ec7e6
commit 0b918437d0
1 changed files with 4 additions and 9 deletions

View File

@ -34,6 +34,7 @@ local function doMainWin()
-- download! -- download!
local req, err = primaryINet.request(nurl) local req, err = primaryINet.request(nurl)
if not req then if not req then
fd.close()
neoux.startDialog("failed request:\n" .. tostring(err)) neoux.startDialog("failed request:\n" .. tostring(err))
w.reset(doMainWin()) w.reset(doMainWin())
return return
@ -43,12 +44,9 @@ local function doMainWin()
while sRunning do while sRunning do
local n, n2 = req.read(neo.readBufSize) local n, n2 = req.read(neo.readBufSize)
if not n then if not n then
req.close()
fd.close()
if n2 then if n2 then
neoux.startDialog("failed download:\n" .. tostring(n2)) neoux.startDialog("failed download:\n" .. tostring(n2))
w.reset(doMainWin()) break
return
else else
break break
end end
@ -58,11 +56,8 @@ local function doMainWin()
else else
local o, r = fd.write(n) local o, r = fd.write(n)
if not o then if not o then
req.close()
fd.close()
neoux.startDialog("failed write:\n" .. tostring(r)) neoux.startDialog("failed write:\n" .. tostring(r))
w.reset(doMainWin()) break
return
end end
end end
end end
@ -76,7 +71,7 @@ local function doMainWin()
running = false running = false
end, 0xFFFFFF, 0) end, 0xFFFFFF, 0)
end end
local w = neoux.create(doMainWin) local w = neoux.create(doMainWin())
while running do while running do
event.pull() event.pull()