diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2013-06-22 01:12:20 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-06-22 01:12:20 +0100 |
commit | dfade0b0a301eaa921d5a1896b4d409d10e9c25f (patch) | |
tree | f2774d63cb20fd14469a2cf4263d866b44ddd0c5 /src/rabbit_limiter.erl | |
parent | 0371265eb754b0e7b364d1a5d9e3c7624f59f91f (diff) | |
download | rabbitmq-server-dfade0b0a301eaa921d5a1896b4d409d10e9c25f.tar.gz |
prevent invalid state transitionbug25640
from 'dormant' to 'active' w/o registration
This was very hard to trigger, but nevertheless possible.
Diffstat (limited to 'src/rabbit_limiter.erl')
-rw-r--r-- | src/rabbit_limiter.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rabbit_limiter.erl b/src/rabbit_limiter.erl index 1e32f95a..6a09573c 100644 --- a/src/rabbit_limiter.erl +++ b/src/rabbit_limiter.erl @@ -255,7 +255,9 @@ safe_call(Pid, Msg, ExitValue) -> fun () -> ExitValue end, fun () -> gen_server2:call(Pid, Msg, infinity) end). -resume(L) -> L#qstate{state = active}. +resume(L = #qstate{state = suspended}) -> + L#qstate{state = active}; +resume(L) -> L. deactivate(L = #qstate{state = dormant}) -> L; deactivate(L) -> |