diff options
| author | Ben Fuhrmannek | 2021-09-23 12:23:40 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2021-09-23 12:23:40 +0200 |
| commit | 54c352c1b5aa08b187dd1e52e544709cad2b0fee (patch) | |
| tree | d15bf0f484c6baa1f2718e625e0d49f6fb488507 /src/sp_config.h | |
| parent | 887e1c9d44fbcf5f23a928269034593b8521aaba (diff) | |
config is stack allocated now + some code improvements (see details)
* for easier memory manegement, the entire sp_config struct was merged into snuffleupagus_globals and allocated on stack where possible
* SNUFFLEUPAGUS_G() can be written as SPG(), which is faster to type and easier to read
* execution_depth is re-initialized to 0 for each request
* function calls with inline string and length parameters consistently use ZEND_STRL instead of sizeof()-1
* execution is actually hooked if recursion protection is enabled
* some line breaks were removed to make the code more readable
Diffstat (limited to 'src/sp_config.h')
| -rw-r--r-- | src/sp_config.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/sp_config.h b/src/sp_config.h index df36976..262050b 100644 --- a/src/sp_config.h +++ b/src/sp_config.h | |||
| @@ -33,11 +33,6 @@ typedef struct { | |||
| 33 | } sp_cidr; | 33 | } sp_cidr; |
| 34 | 34 | ||
| 35 | typedef struct { | 35 | typedef struct { |
| 36 | zend_string *encryption_key; | ||
| 37 | zend_string *cookies_env_var; | ||
| 38 | } sp_config_global; | ||
| 39 | |||
| 40 | typedef struct { | ||
| 41 | bool enable; | 36 | bool enable; |
| 42 | bool simulation; | 37 | bool simulation; |
| 43 | zend_string *dump; | 38 | zend_string *dump; |
| @@ -181,35 +176,6 @@ typedef struct { | |||
| 181 | HashTable *entries; // ht of sp_ini_entry | 176 | HashTable *entries; // ht of sp_ini_entry |
| 182 | } sp_config_ini; | 177 | } sp_config_ini; |
| 183 | 178 | ||
| 184 | typedef struct { | ||
| 185 | sp_config_random *config_random; | ||
| 186 | sp_config_sloppy *config_sloppy; | ||
| 187 | sp_config_unserialize *config_unserialize; | ||
| 188 | sp_config_readonly_exec *config_readonly_exec; | ||
| 189 | sp_config_upload_validation *config_upload_validation; | ||
| 190 | sp_config_cookie *config_cookie; | ||
| 191 | sp_config_global *config_snuffleupagus; | ||
| 192 | sp_config_auto_cookie_secure *config_auto_cookie_secure; | ||
| 193 | sp_config_global_strict *config_global_strict; | ||
| 194 | sp_config_disable_xxe *config_disable_xxe; | ||
| 195 | sp_config_eval *config_eval; | ||
| 196 | sp_config_wrapper *config_wrapper; | ||
| 197 | sp_config_session *config_session; | ||
| 198 | sp_config_ini *config_ini; | ||
| 199 | bool hook_execute; | ||
| 200 | char log_media; | ||
| 201 | u_long max_execution_depth; | ||
| 202 | bool server_encode; | ||
| 203 | bool server_strip; | ||
| 204 | |||
| 205 | HashTable *config_disabled_functions; | ||
| 206 | HashTable *config_disabled_functions_hooked; | ||
| 207 | HashTable *config_disabled_functions_ret; | ||
| 208 | HashTable *config_disabled_functions_ret_hooked; | ||
| 209 | sp_config_disabled_functions *config_disabled_functions_reg; | ||
| 210 | sp_config_disabled_functions *config_disabled_functions_reg_ret; | ||
| 211 | } sp_config; | ||
| 212 | |||
| 213 | #define SP_PARSE_FN_(fname, kwvar) int fname(char *token, sp_parsed_keyword *kwvar, void *retval) | 179 | #define SP_PARSE_FN_(fname, kwvar) int fname(char *token, sp_parsed_keyword *kwvar, void *retval) |
| 214 | #define SP_PARSE_FN(fname) SP_PARSE_FN_(fname, parsed_rule) | 180 | #define SP_PARSE_FN(fname) SP_PARSE_FN_(fname, parsed_rule) |
| 215 | #define SP_PARSEKW_FN(fname) SP_PARSE_FN_(fname, kw) | 181 | #define SP_PARSEKW_FN(fname) SP_PARSE_FN_(fname, kw) |
