[MINOR] sessions: only wake waiting listeners up if rate limit is OK

Instead of waking a listener up then making it sleep, we only wake them up
if we know their rate limit is fine. In the future we could improve on top
of that by deciding to wake a proxy-specific task in XX milliseconds to
take care of enabling the listeners again.
This commit is contained in:
Willy Tarreau 2011-07-25 08:37:44 +02:00
parent d408bd40f3
commit b32907b6c7

View File

@ -2096,7 +2096,8 @@ struct task *process_session(struct task *t)
if (!LIST_ISEMPTY(&global_listener_queue))
dequeue_all_listeners(&global_listener_queue);
if (!LIST_ISEMPTY(&s->fe->listener_queue))
if (!LIST_ISEMPTY(&s->fe->listener_queue) &&
(!s->fe->fe_sps_lim || freq_ctr_remain(&s->fe->fe_sess_per_sec, s->fe->fe_sps_lim, 0) > 0))
dequeue_all_listeners(&s->fe->listener_queue);
if (unlikely((global.mode & MODE_DEBUG) &&