@@ -385,32 +385,41 @@ static void php_binary_init(void)
385
385
}
386
386
/* }}} */
387
387
388
- /* {{{ PHP_INI_MH */
389
- static PHP_INI_MH (OnUpdateTimeout )
388
+ static void updateTimeout (zend_string * new_value , int stage )
390
389
{
391
- if (stage == PHP_INI_STAGE_STARTUP ) {
390
+ if (stage == PHP_INI_STAGE_STARTUP ) {
392
391
/* Don't set a timeout on startup, only per-request */
393
392
ZEND_ATOL (EG (timeout_seconds ), ZSTR_VAL (new_value ));
394
- return SUCCESS ;
393
+ return ;
395
394
}
396
395
zend_unset_timeout ();
397
396
ZEND_ATOL (EG (timeout_seconds ), ZSTR_VAL (new_value ));
398
397
zend_set_timeout (EG (timeout_seconds ), 0 );
398
+ }
399
+
400
+ /* {{{ PHP_INI_MH */
401
+ static PHP_INI_MH (OnUpdateTimeout )
402
+ {
403
+ updateTimeout (new_value , stage );
399
404
return SUCCESS ;
400
405
}
401
406
/* }}} */
402
407
403
408
/* {{{ PHP_INI_MH */
404
409
static PHP_INI_MH (OnUpdateWallTimeout )
405
410
{
406
- if (stage == PHP_INI_STAGE_STARTUP ) {
411
+ #if defined(WIN32 ) || defined(__CYGWIN__ ) || defined(__PASE__ )
412
+ updateTimeout (new_value , stage );
413
+ #else
414
+ if (stage == PHP_INI_STAGE_STARTUP ) {
407
415
/* Don't set a timeout on startup, only per-request */
408
416
ZEND_ATOL (EG (wall_timeout_seconds ), ZSTR_VAL (new_value ));
409
417
return SUCCESS ;
410
418
}
411
419
zend_unset_wall_timeout ();
412
420
ZEND_ATOL (EG (wall_timeout_seconds ), ZSTR_VAL (new_value ));
413
421
zend_set_wall_timeout (EG (wall_timeout_seconds ), 0 );
422
+ #endif
414
423
return SUCCESS ;
415
424
}
416
425
/* }}} */
@@ -1702,7 +1711,9 @@ int php_request_startup(void)
1702
1711
} else {
1703
1712
zend_set_timeout (PG (max_input_time ), 1 );
1704
1713
}
1714
+ #if !defined(WIN32 ) && !defined(__CYGWIN__ ) && !defined(__PASE__ )
1705
1715
zend_set_wall_timeout (EG (wall_timeout_seconds ), 1 );
1716
+ #endif
1706
1717
1707
1718
/* Disable realpath cache if an open_basedir is set */
1708
1719
if (PG (open_basedir ) && * PG (open_basedir )) {
@@ -1792,7 +1803,9 @@ void php_request_shutdown(void *dummy)
1792
1803
/* 4. Reset max_execution_time and max_execution_wall_time (no longer executing php code after response sent) */
1793
1804
zend_try {
1794
1805
zend_unset_timeout ();
1806
+ #if !defined(WIN32 ) && !defined(__CYGWIN__ ) && !defined(__PASE__ )
1795
1807
zend_unset_wall_timeout ();
1808
+ #endif
1796
1809
} zend_end_try ();
1797
1810
1798
1811
/* 5. Call all extensions RSHUTDOWN functions */
0 commit comments