Skip to content
Permalink
Browse files
Fix curl_timeout being ignored for Lua HTTP fetches
  • Loading branch information
sfan5 committed May 17, 2021
1 parent d44f1aa commit b56a028d6bc101cb01f5bdfe07053ac1af9fb016
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/script/lua_api/l_http.cpp
@@ -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)) {

0 comments on commit b56a028

Please sign in to comment.