Felipe Zimmerle
1f80055f63
Constify Transaction on variable resolution
2020-12-22 22:14:45 -03:00
Felipe Zimmerle
64bffdebc4
Cosmetics: Using VariableValues instead of std::vector<...>
...
Making the code more readable.
2020-12-22 22:14:44 -03:00
WGH
6528c95765
Use std::shared_ptr for variable resolution
...
AnchoredSetVariable::resolve is called for every rule
(see RuleWithOperator::evaluate). The previous implementation allocated
a new copy of every variable, which quickly added up. In my tests,
AnchoredSetVariable::resolve function consumed 7.8% of run time.
AnchoredSetVariable (which is a multimap) values are never changed,
only added. This means it's safe to store them in std::shared_ptr,
and make resolve return shared_ptr pointing to the same object.
Other resolve implementation could also use this optimization by not
allocating new objects, however, they are not hot spots, so this
optimization was not implemented there.
In my benchmark, this raises performance from 117 requests per second to
131 RPS, and overhead is lowered from 7.8% to 2.4%.
As a bonus, replacing plain pointer with smart pointers make code
cleaner, since using smart pointers makes manual deletes no longer necessary.
Additionally, VariableOrigin is now stored in plain std::vector,
since it's wasteful to store structure containing just two integer
values using std::list<std::unique_ptr<T>>.
2020-12-22 22:14:43 -03:00
Felipe Zimmerle
357c140003
Changens copyright year
2020-01-31 10:32:37 -03:00
Felipe Zimmerle
fe98ce4c7d
Cosmetics: address cppcheck warnings
2020-01-30 18:19:34 -03:00
Felipe Zimmerle
4e76c6adf0
Renames namespace Variables to variables
2019-03-06 15:53:20 -03:00
Felipe Zimmerle
ee50fea266
Handling key exceptions on the variable itself
...
This is the first step towords to solve #1697
2018-09-24 16:16:30 -03:00
Felipe Zimmerle
eeec7efb68
Renames collection::Variable to VariableValue
2018-02-20 13:40:01 -03:00
Felipe Zimmerle
de7c5c89bb
Using shared var for variables names
2018-02-20 13:40:01 -03:00
Felipe Zimmerle
6f7fdd9493
Using direct variable access instead m_collections
2018-02-20 13:40:01 -03:00
Felipe Zimmerle
3fb71f32d8
Coding style fixes
2017-11-13 22:32:11 -03:00
Felipe Zimmerle
082a3e3287
Adds support to SecWebAppID
2017-11-08 09:33:14 -03:00
Felipe Zimmerle
7ac6bf7241
Fix memory issues while resolving variables
2017-08-27 22:06:20 -03:00
Felipe Zimmerle
003a8e8e5f
Uses shared_ptr on variable names
2017-08-27 22:06:20 -03:00
Felipe Zimmerle
e95efa05cc
Fix assorted memory and static analysis errors
2017-03-06 15:02:00 -03:00
Felipe Zimmerle
f2d149fc5f
Extends the direct access model to other collections
2017-03-06 15:02:00 -03:00
Felipe Zimmerle
17e5a63577
Removes memory leak on the "offset" feature
2017-03-06 15:01:59 -03:00
Felipe Zimmerle
c1f11ab4e5
Cosmetics: assorted fixes on the coding style
2017-03-06 15:01:59 -03:00
Felipe Zimmerle
ecbf292f6d
Adds first PoC for the operator offset feature
2017-03-06 15:01:59 -03:00
Felipe Zimmerle
9a8fc3116a
Instantiates the Class variable earlier
...
Avoid the instantiation for every call
2017-03-06 15:01:59 -03:00
Felipe Zimmerle
a7f465cf3a
Avoids string copy by working with pointers while resolving variables
2016-12-28 20:00:14 -03:00
Felipe Zimmerle
168fa22e19
Collections cleanup: removes resolveFirstCopy method
2016-12-28 19:56:27 -03:00
Felipe Zimmerle
4cf6c714ac
Cosmetics: Fix coding style
2016-07-12 21:59:17 -03:00
Felipe Zimmerle
833089eb70
Adds method resolveFirstCopy to collections
...
Using the copy whenever it is necessary to avoid memory leak.
2016-07-08 10:22:37 -03:00
Felipe Zimmerle
7bcc9cf0d9
Bug fix: variable resolution inside global collections
...
Collections were being resolved as transient variables.
2016-07-07 10:32:48 -03:00
Felipe Zimmerle
e231503bc9
Simplifies the collection interface
2016-07-05 09:48:58 -03:00
Felipe Zimmerle
2477470607
Adds support to the resource collection
2016-06-24 15:17:29 -03:00
Felipe Zimmerle
9919026620
Fixes regarding memory management
...
Fixes assorted issues identified by valgrind.
2016-06-16 00:03:57 -03:00
Felipe Zimmerle
758ecb5d6d
Adds support to USER collection, setuid action and USERID variable
...
More details on: #1026 , #1024 , #1048
2016-05-09 20:27:08 -03:00
Felipe Zimmerle
a2a47798e9
Adds support to the collection SESSION and setsid action
2016-05-06 14:38:04 -03:00
Felipe Zimmerle
3062ff2aa5
Using Collection instead of GlobalCollection
...
Both has the same methods and characteristics except for the fact that
one is global and the other not. That can be handled by the backend.
2016-05-04 22:42:24 -03:00
Felipe Zimmerle
64c4f23a4e
Collection class was changed to be a simple interface
...
InMomoryPerProcess class was added to be used where the old Collection
was used.
2016-05-04 22:42:17 -03:00