Skip to content

Don't reset the timeout on deactivate when the timeout was changed #6683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,15 @@ static PHP_INI_MH(OnUpdateTimeout)
}
zend_unset_timeout();
ZEND_ATOL(EG(timeout_seconds), ZSTR_VAL(new_value));
zend_set_timeout(EG(timeout_seconds), 0);
if (stage != PHP_INI_STAGE_DEACTIVATE) {
/*
* If we're restoring INI values, we shouldn't reset the timer.
* Otherwise, the timer is active when PHP is idle, such as the
* the CLI web server or CGI. Running a script will re-activate
* the timeout, so it's not needed to do so at script end.
*/
zend_set_timeout(EG(timeout_seconds), 0);
}
return SUCCESS;
}
/* }}} */
Expand Down