This commit is contained in:
Alessandro Proto 2023-03-10 16:02:42 +01:00
parent 6d4161e251
commit b2e7969793
2 changed files with 8 additions and 12 deletions

View file

@ -96,19 +96,15 @@ local function printError( text )
end end
local function hget(url, headers) local function hget(url, headers)
local requestId = http.requestAsync(url, nil, headers, {binary = true}) local response, err = http.requestAsync(url, nul, headers, {binary = true}):await()
local ev, rId, par, info if not response then
repeat return nil, err
ev, rId, par, info = event.pull("http_response", "http_failure")
until rId == requestId
if ev == "http_failure" then
return nil, par
end end
local content = par:read("a")
par:close() local content = response.content:read("a")
return content, info response.content:close()
return content, response
end end
local function promptKey() local function promptKey()

View file

@ -28,7 +28,7 @@ public class PanicScreen
Term.ForegroundColor = ForegroundColor; Term.ForegroundColor = ForegroundColor;
Term.BackgroundColor = BackgroundColor; Term.BackgroundColor = BackgroundColor;
Term.SetCursorBlink(false); Term.SetCursorBlink(false);
Term.SetSize(53, 20); Term.SetSize(57, 23);
Term.Clear(); Term.Clear();
var title = " Capy64 "; var title = " Capy64 ";