Parcourir la source

stole some code from AmandaC to handle an undocumented condition with 404 errors returned by the internet card

master
XeonSquared il y a 3 ans
Parent
révision
5e9baee9fa
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. +8
    -1
      lib/download.lua

+ 8
- 1
lib/download.lua Voir le fichier

@@ -85,8 +85,15 @@ function dl.protos.http(host, optPort, path, dest, url) -- string string string
local R,r=component.invoke(component.list("internet")(),"request",url) local R,r=component.invoke(component.list("internet")(),"request",url)
if not R then error(r) end if not R then error(r) end
repeat repeat
ok, err = R.finishConnect()
if type(ok) ~= "boolean" then
if err == url then
return 404, "This is a bug in OC, I think?"
end
return -1, err or "Connection Error"
end
coroutine.yield() coroutine.yield()
until R.finishConnect()
until ok
local code, messsage, headers local code, messsage, headers
repeat repeat
coroutine.yield() coroutine.yield()


Chargement…
Annuler
Enregistrer