14660f677e16a5c36f3c43e9e64f5e021fda627b |
|
25-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
director: Don't send USERs in handshake that were already sent between handshake
If the user was refreshed since the handshake was started, it means that
the same user was already sent to the other side (added to the stream
immediately after it was received/handled). There's no need to send it
again.
This fixes a potentally infinite handshake when users are rapidly changing
and the handshake iterator never sees the end of the list. (Each refreshed
user is moved to the end of the list, so handshaking can keep sending the
same user over and over again.) |
94fb15fffc814d7dcecabf8d90691502311d4b88 |
|
24-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
director: Keep users unsorted during handshake and sort them at the end
This is simpler and sometimes more efficient than the current way of
immediately inserting the users to the correct place in the linked list.
This is especially useful if handshaking is mixed with regular USER updates,
because each switch between them required walking the linked list backwards
to find the proper insert position.
It's not a big problem if the users list is temporarily unordered. It mainly
means that some of the users won't be expired as early as they should have. |
7d8c1ba766770ea1c6d4d6770a31832b5b518648 |
|
06-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
director: Fix off-by-one when checking if user weakness is stuck
When the weakness was exactly at the second, the weakness wasn't detected
and the next expiration timeout was removed entirely. This shouldn't have
caused any bigger problems, because another user lookup on the following
second would have then detected the weakness, removed the user and restored
the next expiration timeout. |
1b7cd57585d8c2f133dd612d2d5d9c775595659f |
|
25-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
director: Moved all user killing state to struct director_kill_context
This should make it a bit easier to understand the life time of user
killing. It also simplifies code by removing struct
director_user_kill_finish_ctx.
Finally, this already reduces memory usage with 32bit systems, and would
make it possible to reduce also on 64bit systems if timestamp is shrank to
31 bits and weak bit moved after it. I'm not sure if that would be better
for performance though. In any case it would provide free space for 4 extra
bytes if that were needed in future. |
f9c76559302e6485f59ab0e6050b76fd6d268fee |
|
25-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
director: Prevent race conditions by adding USER_KILL_STATE_FLUSHING
In theory it's possible that a user is freed during a flush and added back
before flush is finished, possibly even being moved again. This check makes
sure that we don't finish such move unless we're actually at the correct
flushing state. (If there's another flush also running for the user it'll
be ignored.)
This is also useful for logging purposes. |