empty timeout should be unlimited, not immediate death

This commit is contained in:
Shish 2023-06-28 12:51:43 +00:00
parent c5273c4b05
commit 0c45cf17b2

View file

@ -103,7 +103,11 @@ $_shm_timeout = null;
function shm_set_timeout(?int $timeout=null): void
{
global $_shm_timeout;
$_shm_timeout = ftime() + $timeout;
if ($timeout) {
$_shm_timeout = ftime() + $timeout;
} else {
$_shm_timeout = null;
}
set_time_limit(is_null($timeout) ? 0 : $timeout);
}