Permalink
Browse files

[phpembed] Really kill PHP execution timeouts

Summary: Explicitly clear the interval timer and then remove the signal handler
  so that we can ensure the timeout handler never gets called; it was screwing
  up the feed publisher in a rather horrifying way.

Reviewed by: marcel
Test Plan: new publisher, gdb, hope
Revert: ok



git-svn-id: svn+ssh://tubbs/svnroot/projects/phpembed/trunk@83353 2c7ba8d8-a2f7-0310-a573-de162e16dcc7
  • Loading branch information...
1 parent 99736a1 commit 87de4fc98c6cb84488997b1fe8fd0b1877ab7fe6 dweatherford committed Feb 16, 2008
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/php_cxx.cpp
View
5 src/php_cxx.cpp
@@ -4,6 +4,7 @@
#include "php_cxx.h"
#include <stdio.h>
+#include <signal.h>
void php::set_message_function(void (*_message_function)(const char *)){
p.message_function = _message_function;
@@ -984,6 +985,10 @@ php::php(bool _type_warnings)
// as an embedded module, we don't want any PHP timeout!
php_set_ini_entry("max_execution_time", "0", PHP_INI_STAGE_ACTIVATE);
+ // Terminate any currently running timeout interval-timer
+ zend_unset_timeout(TSRMLS_C);
+ // And remove the signal handler just to make sure
+ signal(SIGPROF, SIG_IGN);
// we don't have get or post or cookie data in an embedded context
php_set_ini_entry("variables_order", "S", PHP_INI_STAGE_ACTIVATE);

0 comments on commit 87de4fc

Please sign in to comment.