Skip to content

Commit

Permalink
Fix curl_timeout being ignored for Lua HTTP fetches
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed May 17, 2021
1 parent d44f1aa commit b56a028
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/script/lua_api/l_http.cpp
Expand Up @@ -42,12 +42,10 @@ void ModApiHttp::read_http_fetch_request(lua_State *L, HTTPFetchRequest &req)

req.caller = httpfetch_caller_alloc_secure();
getstringfield(L, 1, "url", req.url);
lua_getfield(L, 1, "user_agent");
if (lua_isstring(L, -1))
req.useragent = getstringfield_default(L, 1, "user_agent", "");
lua_pop(L, 1);
getstringfield(L, 1, "user_agent", req.useragent);
req.multipart = getboolfield_default(L, 1, "multipart", false);
req.timeout = getintfield_default(L, 1, "timeout", 3) * 1000;
if (getintfield(L, 1, "timeout", req.timeout))
req.timeout *= 1000;

lua_getfield(L, 1, "method");
if (lua_isstring(L, -1)) {
Expand Down

0 comments on commit b56a028

Please sign in to comment.