Fix #3580212: Connection drops after a few hours
commit03dce9236851505acd5254afb2cab0326db1cd81
authorStefan Becker <chemobejk@gmail.com>
Wed, 21 Nov 2012 15:36:02 +0000 (21 17:36 +0200)
committerStefan Becker <chemobejk@gmail.com>
Wed, 21 Nov 2012 15:45:32 +0000 (21 17:45 +0200)
tree29a827b33d5954325846d6bffba3576718184945
parentaf8489cd4cffea98de1208b75ea41e4e24e3cdb6
Fix #3580212: Connection drops after a few hours

When we receive a 401 Unauthorized to a REGISTER message we used to
check the register attempt counter. But that was obsoleted and now we
check if the security context is already valid, i.e. when the
authentication handshake has failed.

While this is the correct behaviour during an authentication handshake,
this change unfortunately now prevents the code from reaching the next
check, where we check for failed RE-REGISTER attempts. Thus a failed
RE-REGISTER attempt leads to a connection failure instead of a forced
re-authentication attempt.

Swapping the checks in sip-transport.c fixes this problem.
src/core/sip-transport.c