add 'timeout_ms' to network.request

This commit is contained in:
MihailRis 2026-09-11 21:19:13 +03:00
parent a5f9eafe23
commit fc877f09cb

View file

@ -109,6 +109,10 @@ static int l_request(lua::State* L, network::Network& network) {
request.followLocation = lua::toboolean(L, -1); request.followLocation = lua::toboolean(L, -1);
lua::pop(L); lua::pop(L);
} }
if (lua::getfield(L, "timeout_ms", 2)) {
request.timeoutMs = lua::tointeger(L, -1);
lua::pop(L);
}
int currentRequestId = request_id++; int currentRequestId = request_id++;
request.onResponse = [currentRequestId](std::vector<char> bytes) { request.onResponse = [currentRequestId](std::vector<char> bytes) {