diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-02-17 10:31:56 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-02-17 10:31:56 +0100 |
commit | b14f992ef5f4e868c9959b174278c86516d60dbc (patch) | |
tree | 28587bb46c025ea7b0d27ba93f09c93dcf53c73a /tex/context/base/mkiv/data-sch.lua | |
parent | 95a1799032dc61dbca4a11e495be34b4397c8fec (diff) | |
download | context-b14f992ef5f4e868c9959b174278c86516d60dbc.tar.gz |
2017-02-17 10:23:00
Diffstat (limited to 'tex/context/base/mkiv/data-sch.lua')
-rw-r--r-- | tex/context/base/mkiv/data-sch.lua | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/data-sch.lua b/tex/context/base/mkiv/data-sch.lua index d79e0c7ef..23ecdc122 100644 --- a/tex/context/base/mkiv/data-sch.lua +++ b/tex/context/base/mkiv/data-sch.lua @@ -61,12 +61,21 @@ function resolvers.schemes.cleanname(specification) return hash end -local cached, loaded, reused, thresholds, handlers = { }, { }, { }, { }, { } - -local function runcurl(name,cachename) -- we use sockets instead or the curl library when possible - local command = "curl --silent --insecure --create-dirs --output " .. cachename .. " " .. name - os.execute(command) -end +local cached = { } +local loaded = { } +local reused = { } +local thresholds = { } +local handlers = { } +local runner = sandbox.registerrunner { + name = "curl resolver", + method = "execute", + program = "curl", + template = "--silent -- insecure --create-dirs --output %cachename% %original%", + checkers = { + cachename = "cache", + original = "url", + } +} local function fetch(specification) local original = specification.original @@ -89,7 +98,10 @@ local function fetch(specification) report_schemes("fetching %a, protocol %a, method %a",original,scheme,"curl") end logs.flush() - runcurl(original,cachename) + runner { + original = original, + cachename = cachename, + } end end if io.exists(cachename) then @@ -184,10 +196,6 @@ end) local httprequest = http.request local toquery = url.toquery --- local function httprequest(url) --- return os.resultof(format("curl --silent %q", url)) --- end - local function fetchstring(url,data) local q = data and toquery(data) if q then |