From 7963580d72a358975133f86f01de2d2eab08ba38 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Fri, 13 Jul 2018 10:36:50 +0200 Subject: Massively optimize how rules are handled This commit does a lot of things: - Use hashtables instead of lists to store the rules - Rules that can be applied at launch time won't be tried at runtime - Improve feedback when writing nonsensical rules - Make intensive use of `zend_string` instead of `char*`--- src/sp_disabled_functions.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/sp_disabled_functions.h') diff --git a/src/sp_disabled_functions.h b/src/sp_disabled_functions.h index f80c9c2..4e795a1 100644 --- a/src/sp_disabled_functions.h +++ b/src/sp_disabled_functions.h @@ -2,8 +2,11 @@ #define __SP_DISABLE_FUNCTIONS_H int hook_disabled_functions(); -bool should_disable(zend_execute_data *, const char *, const char *, - const char *); -bool should_drop_on_ret(zval *, const zend_execute_data *const); +bool should_disable(zend_execute_data *, const char *, const zend_string *, + const char *, const sp_list_node *, const zend_string *); +bool should_disable_ht(zend_execute_data *, const char *, const zend_string *, + const char *, const sp_list_node *, const HashTable *); +bool should_drop_on_ret_ht(zval *, const zend_execute_data *const, const sp_list_node* config, const HashTable *); +bool should_drop_on_ret(zval *, const sp_list_node* config, const char *); #endif /* __SP_DISABLE_FUNCTIONS_H */ -- cgit v1.3