diff options
author | Anders Svensson <[email protected]> | 2013-05-27 16:32:41 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-05-27 17:20:35 +0200 |
commit | 1229133ff6600492bcc2f5e94800b795eec9e95f (patch) | |
tree | 0a8e4cd5ca58e9c0b8c9adf750247bf790d95099 /lib/diameter/src | |
parent | 58de241d5d8e4b0536389b317ecc6e7a2a570997 (diff) | |
download | otp-1229133ff6600492bcc2f5e94800b795eec9e95f.tar.gz otp-1229133ff6600492bcc2f5e94800b795eec9e95f.tar.bz2 otp-1229133ff6600492bcc2f5e94800b795eec9e95f.zip |
Fix watchdog function_clause
Commit 0b7c87dc caused diameter_watchdog:restart/2 to start returning
'stop', so that a watchdog process for a listening transport that
allowed multiple connections to the same peer would die one watchdog
timeout after losing a connection. The new return value was supposed to
be passed up to transition/2, but was instead passed to set_watchdog/1,
resulting in a function_clause error. The resulting crash was harmless
but unseemly.
Not detected by dialyzer.
Thanks to Aleksander Nycz.
Diffstat (limited to 'lib/diameter/src')
-rw-r--r-- | lib/diameter/src/base/diameter_watchdog.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl index 41c493ff20..88ccf630e2 100644 --- a/lib/diameter/src/base/diameter_watchdog.erl +++ b/lib/diameter/src/base/diameter_watchdog.erl @@ -505,7 +505,9 @@ set_watchdog(#watchdog{tw = TwInit, tref = TRef} = S) -> cancel(TRef), - S#watchdog{tref = erlang:start_timer(tw(TwInit), self(), tw)}. + S#watchdog{tref = erlang:start_timer(tw(TwInit), self(), tw)}; +set_watchdog(stop = No) -> + No. cancel(undefined) -> ok; |