mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-14 01:30:54 +00:00
BUG/MINOR: listener: Don't schedule frontend without task in listener_release()
null pointer dereference was reported by Coverity in listener_release()
function. Indeed, we must not try to schedule frontend without task when a
limit is still blocking the frontend. This issue was introduced by commit
65ae1347c7
("BUG/MINOR: listener: Wake proxy's mngmt task up if necessary on
session release")
This patch should fix issue #2488. It must be backported to all stable
version with the commit above.
This commit is contained in:
parent
65ae1347c7
commit
f31a4e302e
@ -1606,7 +1606,7 @@ void listener_release(struct listener *l)
|
|||||||
unsigned int wait;
|
unsigned int wait;
|
||||||
int expire = TICK_ETERNITY;
|
int expire = TICK_ETERNITY;
|
||||||
|
|
||||||
if (fe->fe_sps_lim &&
|
if (fe->task && fe->fe_sps_lim &&
|
||||||
(wait = next_event_delay(&fe->fe_sess_per_sec,fe->fe_sps_lim, 0))) {
|
(wait = next_event_delay(&fe->fe_sess_per_sec,fe->fe_sps_lim, 0))) {
|
||||||
/* we're blocking because a limit was reached on the number of
|
/* we're blocking because a limit was reached on the number of
|
||||||
* requests/s on the frontend. We want to re-check ASAP, which
|
* requests/s on the frontend. We want to re-check ASAP, which
|
||||||
@ -1614,7 +1614,7 @@ void listener_release(struct listener *l)
|
|||||||
* timer will have settled down.
|
* timer will have settled down.
|
||||||
*/
|
*/
|
||||||
expire = tick_first(fe->task->expire, tick_add(now_ms, wait));
|
expire = tick_first(fe->task->expire, tick_add(now_ms, wait));
|
||||||
if (fe->task && tick_isset(expire))
|
if (tick_isset(expire))
|
||||||
task_schedule(fe->task, expire);
|
task_schedule(fe->task, expire);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user