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_session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp_session.c') diff --git a/src/sp_session.c b/src/sp_session.c index ce852ad..ea65f57 100644 --- a/src/sp_session.c +++ b/src/sp_session.c @@ -51,7 +51,7 @@ static int sp_hook_s_read(PS_READ_ARGS) { static int sp_hook_s_write(PS_WRITE_ARGS) { if (ZSTR_LEN(val) > 0 && SNUFFLEUPAGUS_G(config).config_session->encrypt) { - zend_string *new_val = encrypt_zval(ZSTR_VAL(val), ZSTR_LEN(val)); + zend_string *new_val = encrypt_zval(val); return old_s_write(mod_data, key, new_val, maxlifetime); } return old_s_write(mod_data, key, val, maxlifetime); @@ -150,4 +150,4 @@ void hook_session() { s_module = NULL; sp_hook_session_module(); -} \ No newline at end of file +} -- cgit v1.3