mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
6c158374ba
After the sigsetjmp change, this is patch #2 in an effort to get some sanity restored to signal handling in PHP. This patch does two things. First, it makes it possible to reset the timeout without resetting the signal handlers. This is important for cases where an extension may have deferred signals in its MINIT in order to implement critical sections. It also lays the groundwork for cleaning up our signal handling and perhaps eventually implementing our own signal deferring mechanism so we can have true critical sections. The second thing this does is to make it possible to terminate the current child process (only for Apache1 at the moment) on a timeout. There are a number of extensions that are unhappy about being longjmp'ed out of and when this happens on a timeout they are left in an inconsistent state. By turning on exit_on_timeout you can now force the process to terminate on a timeout which will clean up any hanging locks and/or memory left hanging after the longjmp.
179 lines
4.1 KiB
C
179 lines
4.1 KiB
C
/*
|
|
+----------------------------------------------------------------------+
|
|
| PHP Version 5 |
|
|
+----------------------------------------------------------------------+
|
|
| Copyright (c) 1997-2008 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 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: Zeev Suraski <zeev@zend.com> |
|
|
+----------------------------------------------------------------------+
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
#ifndef PHP_GLOBALS_H
|
|
#define PHP_GLOBALS_H
|
|
|
|
#include "zend_globals.h"
|
|
|
|
typedef struct _php_core_globals php_core_globals;
|
|
|
|
#ifdef ZTS
|
|
# define PG(v) TSRMG(core_globals_id, php_core_globals *, v)
|
|
extern PHPAPI int core_globals_id;
|
|
#else
|
|
# define PG(v) (core_globals.v)
|
|
extern ZEND_API struct _php_core_globals core_globals;
|
|
#endif
|
|
|
|
/* Error display modes */
|
|
#define PHP_DISPLAY_ERRORS_STDOUT 1
|
|
#define PHP_DISPLAY_ERRORS_STDERR 2
|
|
|
|
/* Track vars */
|
|
#define TRACK_VARS_POST 0
|
|
#define TRACK_VARS_GET 1
|
|
#define TRACK_VARS_COOKIE 2
|
|
#define TRACK_VARS_SERVER 3
|
|
#define TRACK_VARS_ENV 4
|
|
#define TRACK_VARS_FILES 5
|
|
#define TRACK_VARS_REQUEST 6
|
|
|
|
struct _php_tick_function_entry;
|
|
|
|
typedef struct _arg_separators {
|
|
char *output;
|
|
char *input;
|
|
} arg_separators;
|
|
|
|
struct _php_core_globals {
|
|
zend_bool magic_quotes_gpc;
|
|
zend_bool magic_quotes_runtime;
|
|
zend_bool magic_quotes_sybase;
|
|
|
|
zend_bool safe_mode;
|
|
|
|
zend_bool allow_call_time_pass_reference;
|
|
zend_bool implicit_flush;
|
|
|
|
long output_buffering;
|
|
|
|
char *safe_mode_include_dir;
|
|
zend_bool safe_mode_gid;
|
|
zend_bool sql_safe_mode;
|
|
zend_bool enable_dl;
|
|
|
|
char *output_handler;
|
|
|
|
char *unserialize_callback_func;
|
|
long serialize_precision;
|
|
|
|
char *safe_mode_exec_dir;
|
|
|
|
long memory_limit;
|
|
long max_input_time;
|
|
|
|
zend_bool track_errors;
|
|
zend_bool display_errors;
|
|
zend_bool display_startup_errors;
|
|
zend_bool log_errors;
|
|
long log_errors_max_len;
|
|
zend_bool ignore_repeated_errors;
|
|
zend_bool ignore_repeated_source;
|
|
zend_bool report_memleaks;
|
|
char *error_log;
|
|
|
|
char *doc_root;
|
|
char *user_dir;
|
|
char *include_path;
|
|
char *open_basedir;
|
|
char *extension_dir;
|
|
|
|
char *upload_tmp_dir;
|
|
long upload_max_filesize;
|
|
|
|
char *error_append_string;
|
|
char *error_prepend_string;
|
|
|
|
char *auto_prepend_file;
|
|
char *auto_append_file;
|
|
|
|
arg_separators arg_separator;
|
|
|
|
char *variables_order;
|
|
|
|
HashTable rfc1867_protected_variables;
|
|
|
|
short connection_status;
|
|
short ignore_user_abort;
|
|
|
|
unsigned char header_is_being_sent;
|
|
|
|
zend_llist tick_functions;
|
|
|
|
zval *http_globals[6];
|
|
|
|
zend_bool expose_php;
|
|
|
|
zend_bool register_globals;
|
|
zend_bool register_long_arrays;
|
|
zend_bool register_argc_argv;
|
|
zend_bool auto_globals_jit;
|
|
|
|
zend_bool y2k_compliance;
|
|
|
|
char *docref_root;
|
|
char *docref_ext;
|
|
|
|
zend_bool html_errors;
|
|
zend_bool xmlrpc_errors;
|
|
|
|
long xmlrpc_error_number;
|
|
|
|
zend_bool activated_auto_globals[8];
|
|
|
|
zend_bool modules_activated;
|
|
zend_bool file_uploads;
|
|
zend_bool during_request_startup;
|
|
zend_bool allow_url_fopen;
|
|
zend_bool always_populate_raw_post_data;
|
|
zend_bool report_zend_debug;
|
|
|
|
int last_error_type;
|
|
char *last_error_message;
|
|
char *last_error_file;
|
|
int last_error_lineno;
|
|
|
|
char *disable_functions;
|
|
char *disable_classes;
|
|
zend_bool allow_url_include;
|
|
zend_bool exit_on_timeout;
|
|
#ifdef PHP_WIN32
|
|
zend_bool com_initialized;
|
|
#endif
|
|
long max_input_nesting_level;
|
|
zend_bool in_user_include;
|
|
|
|
char *user_ini_filename;
|
|
long user_ini_cache_ttl;
|
|
|
|
char *request_order;
|
|
};
|
|
|
|
|
|
#endif /* PHP_GLOBALS_H */
|
|
|
|
/*
|
|
* Local variables:
|
|
* tab-width: 4
|
|
* c-basic-offset: 4
|
|
* End:
|
|
*/
|