Files
znc/include
Uli Schlachter 414fa40eb5 WebModules: Discard sessions in LRU order
Currently, znc has a limit of 5 web sessions per IP address. This limit exists
to defend against some obvious DoS attacks. When this limit is hit, some session
is discarded.

Previously, we would discard the session that std::multimap::find() would give
us. The multimap used mapped from IP addresses to sessions. Thus, we would
discard the oldest session.

This commit changes this into some least-recently-used logic. Whenever a session
is used, we record the timestamp of this. Then when a session has to be picked
for discarding, the one with the oldest timestamp is used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-12-07 20:56:27 +01:00
..