diff options
| author | Ondřej Surý <ondrej@sury.org> | 2014-08-01 11:17:13 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2014-08-01 11:17:13 +0200 |
| commit | b60f6e95a473d1ae97fdf20cec4cfefc06b24ec2 (patch) | |
| tree | e92e8d3c102992bc63eae4327d3498e7203a9168 /sapi | |
| parent | 09ed144817606a3a835391b12455e6d9cb3a0ae2 (diff) | |
| download | php-b60f6e95a473d1ae97fdf20cec4cfefc06b24ec2.tar.gz | |
New upstream version 5.6.0~rc3+dfsgupstream/5.6.0_rc3+dfsg
Diffstat (limited to 'sapi')
| -rw-r--r-- | sapi/cgi/tests/bug61605.phpt | 2 | ||||
| -rw-r--r-- | sapi/cli/php_cli_server.c | 19 | ||||
| -rw-r--r-- | sapi/cli/tests/bug66830.phpt | 43 | ||||
| -rw-r--r-- | sapi/fpm/config.m4 | 31 | ||||
| -rw-r--r-- | sapi/fpm/fpm/fpm_stdio.c | 4 | ||||
| -rw-r--r-- | sapi/litespeed/lsapi_main.c | 10 | ||||
| -rw-r--r-- | sapi/litespeed/lsapidef.h | 27 | ||||
| -rw-r--r-- | sapi/litespeed/lsapilib.c | 77 | ||||
| -rw-r--r-- | sapi/litespeed/lsapilib.h | 28 | ||||
| -rw-r--r-- | sapi/phpdbg/Makefile.frag | 2 | ||||
| -rw-r--r-- | sapi/phpdbg/phpdbg.c | 22 |
11 files changed, 201 insertions, 64 deletions
diff --git a/sapi/cgi/tests/bug61605.phpt b/sapi/cgi/tests/bug61605.phpt index c6e4cf20c..9c29e6dda 100644 --- a/sapi/cgi/tests/bug61605.phpt +++ b/sapi/cgi/tests/bug61605.phpt @@ -4,6 +4,8 @@ Bug #61605 (header_remove() does not remove all headers) <?php include "skipif.inc"; ?> --GET-- foo=bar +--INI-- +expose_php=On --FILE-- <?php header("A: first"); diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 64cca0eb6..f333addaf 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -666,11 +666,10 @@ static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers TSRMLS h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { - if (!h->header_len) { - continue; + if (h->header_len) { + smart_str_appendl(&buffer, h->header, h->header_len); + smart_str_appendl(&buffer, "\r\n", 2); } - smart_str_appendl(&buffer, h->header, h->header_len); - smart_str_appendl(&buffer, "\r\n", 2); h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); } smart_str_appendl(&buffer, "\r\n", 2); @@ -1686,10 +1685,14 @@ static int php_cli_server_client_read_request_on_header_value(php_http_parser *p return 1; } { - char *header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); - zend_hash_add(&client->request.headers, header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); - zend_hash_add(&client->request.headers_original_case, client->current_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); - efree(header_name); + /* strip off the colon */ + char *orig_header_name = estrndup(client->current_header_name, client->current_header_name_len); + char *lc_header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); + + zend_hash_add(&client->request.headers, lc_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); + zend_hash_add(&client->request.headers_original_case, orig_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); + efree(lc_header_name); + efree(orig_header_name); } if (client->current_header_name_allocated) { diff --git a/sapi/cli/tests/bug66830.phpt b/sapi/cli/tests/bug66830.phpt new file mode 100644 index 000000000..58c07e031 --- /dev/null +++ b/sapi/cli/tests/bug66830.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #66830 (Empty header causes PHP built-in web server to hang) +--SKIPIF-- +<?php +include "skipif.inc"; +?> +--FILE-- +<?php +include "php_cli_server.inc"; +php_cli_server_start(<<<'PHP' +header(' '); +PHP +); + +list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); +$port = intval($port)?:80; + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die("connect failed"); +} + +if(fwrite($fp, <<<HEADER +GET / HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + echo fgets($fp); + } +} + +fclose($fp); +?> +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: close +X-Powered-By: %s +Content-type: text/html; charset=UTF-8 + diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index 40cd69c71..9c10aa6be 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -584,14 +584,41 @@ if test "$PHP_FPM" != "no"; then [ --with-fpm-systemd Activate systemd integration], no, no) if test "$PHP_FPM_SYSTEMD" != "no" ; then - AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon") + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + unset SYSTEMD_LIBS + unset SYSTEMD_INCS + + if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd; then + dnl systemd version >= 209 provides libsystemd + AC_MSG_CHECKING([for libsystemd]) + SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd` + SYSTEMD_INCS=`$PKG_CONFIG --cflags-only-I libsystemd` + SYSTEMD_VERS=`$PKG_CONFIG --modversion libsystemd` + AC_MSG_RESULT([version $SYSTEMD_VERS]) + + elif test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd-daemon; then + dnl systemd version < 209 provides libsystemd-daemon + AC_MSG_CHECKING([for libsystemd-daemon]) + SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd-daemon` + SYSTEMD_INCS=`$PKG_CONFIG --cflags-only-I libsystemd-daemon` + SYSTEMD_VERS=`$PKG_CONFIG --modversion libsystemd-daemon` + AC_MSG_RESULT([version $SYSTEMD_VERS]) + + else + dnl failback when no pkg-config + AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon") + fi + AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"]) if test $HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then AC_MSG_ERROR([Your system does not support systemd.]) else AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration]) PHP_FPM_SD_FILES="fpm/fpm_systemd.c" - PHP_ADD_LIBRARY(systemd-daemon) + PHP_EVAL_LIBLINE($SYSTEMD_LIBS) + PHP_EVAL_INCLINE($SYSTEMD_INCS) php_fpm_systemd=notify fi else diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c index 33b0e01c8..fcec78435 100644 --- a/sapi/fpm/fpm/fpm_stdio.c +++ b/sapi/fpm/fpm/fpm_stdio.c @@ -268,7 +268,11 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */ if (!strcasecmp(fpm_global_config.error_log, "syslog")) { openlog(fpm_global_config.syslog_ident, LOG_PID | LOG_CONS, fpm_global_config.syslog_facility); fpm_globals.error_log_fd = ZLOG_SYSLOG; +#if HAVE_UNISTD_H + if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) { +#else if (fpm_global_config.daemonize) { +#endif zlog_set_fd(fpm_globals.error_log_fd); } return 0; diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 34ae751b2..3413a423a 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,8 +16,6 @@ +----------------------------------------------------------------------+ */ -/* $Id: lsapi_main.c,v 1.57 2013/08/23 14:50:25 gwang Exp $ */ - #include "php.h" #include "SAPI.h" #include "php_main.h" @@ -372,7 +370,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC) static sapi_module_struct lsapi_sapi_module = { "litespeed", - "LiteSpeed V6.4", + "LiteSpeed V6.6", php_lsapi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ @@ -737,9 +735,9 @@ static int cli_main( int argc, char * argv[] ) case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); diff --git a/sapi/litespeed/lsapidef.h b/sapi/litespeed/lsapidef.h index 5d5b4c168..fb75d01a1 100644 --- a/sapi/litespeed/lsapidef.h +++ b/sapi/litespeed/lsapidef.h @@ -1,5 +1,23 @@ /* -Copyright (c) 2005, Lite Speed Technologies Inc. + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2014 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: George Wang <gwang@litespeedtech.com> | + +----------------------------------------------------------------------+ +*/ + +/* +Copyright (c) 2002-2014, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -30,13 +48,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*************************************************************************** - $Id: lsapidef.h,v 1.17 2012/12/01 19:23:31 gwang Exp $ - ------------------- - begin : Thu Feb 10 2005 - author : George Wang - email : gwang@litespeedtech.com - ***************************************************************************/ #ifndef _LSAPIDEF_H_ #define _LSAPIDEF_H_ diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 4a9affc60..786a3bd20 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -1,5 +1,23 @@ /* -Copyright (c) 2013, Lite Speed Technologies Inc. + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2014 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: George Wang <gwang@litespeedtech.com> | + +----------------------------------------------------------------------+ +*/ + +/* +Copyright (c) 2002-2014, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -30,14 +48,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*************************************************************************** - lsapilib.c - description - ------------------- - begin : Mon Feb 21 2005 - copyright : (C) 2005 by George Wang - email : gwang@litespeedtech.com - ***************************************************************************/ - #include <ctype.h> #include <dlfcn.h> @@ -1211,6 +1221,7 @@ int LSAPI_IsRunning(void) int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) { + int newfd; if ( !pReq ) return -1; memset( pReq, 0, sizeof( LSAPI_Request ) ); @@ -1224,7 +1235,14 @@ int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5]; if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 ) return -1; - + + if ( fd == STDIN_FILENO ) + { + fd = dup( fd ); + newfd = open( "/dev/null", O_RDWR ); + dup2( newfd, STDIN_FILENO ); + } + if ( isPipe( fd ) ) { pReq->m_fdListen = -1; @@ -1927,6 +1945,7 @@ int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq, { pKey = pReq->m_pHttpHeader + pCur->nameOff; keyLen = pCur->nameLen; + *(pKey + keyLen ) = 0; pValue = pReq->m_pHttpHeader + pCur->valueOff; *(pValue + pCur->valueLen ) = 0; @@ -2386,6 +2405,8 @@ typedef struct _lsapi_prefork_server int m_iAvoidFork; lsapi_child_status * m_pChildrenStatus; + lsapi_child_status * m_pChildrenStatusCur; + lsapi_child_status * m_pChildrenStatusEnd; }lsapi_prefork_server; @@ -2474,11 +2495,15 @@ static void lsapi_cleanup(int signal) static lsapi_child_status * find_child_status( int pid ) { lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusEnd; while( pStatus < pEnd ) { if ( pStatus->m_pid == pid ) + { + if ( pStatus + 1 > g_prefork_server->m_pChildrenStatusCur ) + g_prefork_server->m_pChildrenStatusCur = pStatus + 1; return pStatus; + } ++pStatus; } return NULL; @@ -2513,8 +2538,12 @@ static void lsapi_sigchild( int signal ) { child_status->m_pid = 0; --g_prefork_server->m_iCurChildren; + } } + while(( g_prefork_server->m_pChildrenStatusCur > g_prefork_server->m_pChildrenStatus ) + &&( g_prefork_server->m_pChildrenStatusCur[-1].m_pid == 0 )) + --g_prefork_server->m_pChildrenStatusCur; } @@ -2523,7 +2552,7 @@ static int lsapi_init_children_status() int size = 4096; char * pBuf; - size = g_prefork_server->m_iMaxChildren * sizeof( lsapi_child_status ) * 2; + size = (g_prefork_server->m_iMaxChildren + g_prefork_server->m_iExtraChildren ) * sizeof( lsapi_child_status ) * 2; size = (size + 4095 ) / 4096 * 4096; pBuf =( char*) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0 ); @@ -2533,7 +2562,9 @@ static int lsapi_init_children_status() return -1; } memset( pBuf, 0, size ); - g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; + g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; + g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf; + g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + size / sizeof( lsapi_child_status ); return 0; } @@ -2563,7 +2594,7 @@ static void lsapi_check_child_status( long tmCur ) int dying = 0; int count = 0; lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusCur; while( pStatus < pEnd ) { tobekilled = 0; @@ -2576,13 +2607,15 @@ static void lsapi_check_child_status( long tmCur ) if (( g_prefork_server->m_iCurChildren - dying > g_prefork_server->m_iMaxChildren)|| ( idle > g_prefork_server->m_iMaxIdleChildren )) { - tobekilled = SIGUSR1; + ++pStatus->m_iKillSent; + //tobekilled = SIGUSR1; } else { if (( s_max_idle_secs> 0)&&(tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5 )) { - tobekilled = SIGUSR1; + ++pStatus->m_iKillSent; + //tobekilled = SIGUSR1; } } if ( !tobekilled ) @@ -2716,6 +2749,8 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re if ( pServer->m_iCurChildren >= (pServer->m_iMaxChildren + pServer->m_iExtraChildren ) ) { + fprintf( stderr, "Reached max children process limit: %d, extra: %d, current: %d, please increase LSAPI_CHILDREN.\n", + pServer->m_iMaxChildren, pServer->m_iExtraChildren, pServer->m_iCurChildren ); usleep( 100000 ); continue; } @@ -2822,8 +2857,8 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re } } sigaction( SIGUSR1, &old_usr1, 0 ); - kill( -getpgrp(), SIGUSR1 ); - lsapi_all_children_must_die(); /* Sorry, children ;-) */ + //kill( -getpgrp(), SIGUSR1 ); + //lsapi_all_children_must_die(); /* Sorry, children ;-) */ return -1; } @@ -2876,7 +2911,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) { if ( !g_running ) return -1; - if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if ((s_req_processed)&&( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; FD_ZERO( &readfds ); FD_SET( fd, &readfds ); @@ -2904,7 +2939,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) } else if ( ret >= 1 ) { - if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if (s_req_processed && ( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; if ( fd == pReq->m_fdListen ) { @@ -3066,6 +3101,8 @@ static int lsapi_initSuEXEC() { if ( g_prefork_server->m_iMaxChildren < 100 ) g_prefork_server->m_iMaxChildren = 100; + if ( g_prefork_server->m_iExtraChildren < 1000 ) + g_prefork_server->m_iExtraChildren = 1000; } } if ( !s_defaultUid || !s_defaultGid ) diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h index b0638fd43..cae1863c7 100644 --- a/sapi/litespeed/lsapilib.h +++ b/sapi/litespeed/lsapilib.h @@ -1,5 +1,23 @@ /* -Copyright (c) 2013, Lite Speed Technologies Inc. + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2014 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: George Wang <gwang@litespeedtech.com> | + +----------------------------------------------------------------------+ +*/ + +/* +Copyright (c) 2002-2014, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -30,14 +48,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*************************************************************************** - lsapilib.h - description - ------------------- - begin : Mon Feb 21 2005 - copyright : (C) 2005 by George Wang - email : gwang@litespeedtech.com - ***************************************************************************/ - #ifndef _LSAPILIB_H_ #define _LSAPILIB_H_ diff --git a/sapi/phpdbg/Makefile.frag b/sapi/phpdbg/Makefile.frag index b276aaaa5..36c7512d6 100644 --- a/sapi/phpdbg/Makefile.frag +++ b/sapi/phpdbg/Makefile.frag @@ -28,7 +28,7 @@ install-phpdbg: $(BUILD_BINARY) @$(INSTALL) -m 0755 $(BUILD_BINARY) $(INSTALL_ROOT)$(bindir)/$(program_prefix)phpdbg$(program_suffix)$(EXEEXT) @echo "Installing phpdbg man page: $(INSTALL_ROOT)$(mandir)/man1/" @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 - @$(INSTALL_DATA) sapi/phpdbg/phpdbg.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)phpdbg$(program_suffix).1 + @$(INSTALL_DATA) $(srcdir)/phpdbg.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)phpdbg$(program_suffix).1 clean-phpdbg: @echo "Cleaning phpdbg object files ..." diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 93fdbd742..1fbd18a42 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -856,7 +856,8 @@ int phpdbg_open_sockets(char *address, int port[2], int (*listen)[2], int (*sock return SUCCESS; } /* }}} */ -void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) { +void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */ +{ int is_handled = FAILURE; TSRMLS_FETCH(); @@ -874,10 +875,11 @@ void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) { break; } -} +} /* }}} */ #endif -static inline zend_mm_heap *phpdbg_mm_get_heap() { +static inline zend_mm_heap *phpdbg_mm_get_heap() /* {{{ */ +{ zend_mm_heap *mm_heap; TSRMLS_FETCH(); @@ -886,22 +888,22 @@ static inline zend_mm_heap *phpdbg_mm_get_heap() { zend_mm_set_heap(mm_heap TSRMLS_CC); return mm_heap; -} +} /* }}} */ -void *phpdbg_malloc_wrapper(size_t size) +void *phpdbg_malloc_wrapper(size_t size) /* {{{ */ { return zend_mm_alloc(phpdbg_mm_get_heap(), size); -} +} /* }}} */ -void phpdbg_free_wrapper(void *p) +void phpdbg_free_wrapper(void *p) /* {{{ */ { zend_mm_free(phpdbg_mm_get_heap(), p); -} +} /* }}} */ -void *phpdbg_realloc_wrapper(void *ptr, size_t size) +void *phpdbg_realloc_wrapper(void *ptr, size_t size) /* {{{ */ { return zend_mm_realloc(phpdbg_mm_get_heap(), ptr, size); -} +} /* }}} */ int main(int argc, char **argv) /* {{{ */ { |
