Fix #3090663: Re-authentication fails (3rd attempt)
commit1391e10c496b63b505c6c7c07cf44fc15742b2da
authorStefan Becker <stefan.becker@nokia.com>
Thu, 21 Oct 2010 17:33:16 +0000 (21 20:33 +0300)
committerAnibal Avelar <aavelar@cofradia.org>
Wed, 3 Nov 2010 03:51:23 +0000 (2 21:51 -0600)
tree2ec2bf6a82f7daf5b449ae9b1b8234fc55b72285
parente625858dab0773044330fae4250363a21175edac
Fix #3090663: Re-authentication fails (3rd attempt)

Commit 2580b6f0e838df159e9aa1ca1c9e4c62dab69c6c fixed the original problem.
But the log provided by the user showed that there are more problems: the code
only handled "401 Unauthorized" error responses to re-REGISTER messages.

The log showed a case where we got a "504 Server time-out" response which we
simply ignored. As the code never sent another REGISTER message the server
dropped the connection after the next re-register timeout and the user got
a "SSL read error" message.

Now the code processes all responses to REGISTER. If we are re-registering then
process_register_response() will handle

 - 401 by triggering a full re-authentication (this fixes the original problem)
 - 504 by scheduling another re-register attempt after 60 seconds
(cherry picked from commit b8ecabd1ba8161a0b30067d478a993866778058e)
src/core/sip-transport.c