FS-11452: [sofia-sip] handle 200/183 w/ sdp receivied out of order quickly

This commit is contained in:
Mike Jerris 2019-02-18 17:06:53 -05:00
parent 7e67dc3c4d
commit 4e930fb089
2 changed files with 15 additions and 11 deletions

View File

@ -1 +1 @@
Wed Feb 21 15:29:04 CST 2018 Mon Feb 18 16:55:02 EST 2019

View File

@ -940,12 +940,12 @@ static int nua_session_client_response(nua_client_request_t *cr,
char const *received = NULL; char const *received = NULL;
#define LOG3(m) \ #define LOG3(m) \
SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s\n", \ SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s (%u)\n", \
(void *)nh, cr->cr_method_name, (m), \ (void *)nh, cr->cr_method_name, (m), \
received ? received : "SDP", status, phrase)) received ? received : "SDP", status, phrase, cr->cr_answer_recv))
#define LOG5(m) \ #define LOG5(m) \
SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s\n", \ SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s (%u)\n", \
(void *)nh, cr->cr_method_name, (m), received, status, phrase)) (void *)nh, cr->cr_method_name, (m), received, status, phrase, cr->cr_answer_recv))
retry: retry:
@ -954,12 +954,16 @@ static int nua_session_client_response(nua_client_request_t *cr,
else if (!session_get_description(sip, &sdp, &len)) else if (!session_get_description(sip, &sdp, &len))
/* No SDP */; /* No SDP */;
else if (cr->cr_answer_recv) { else if (cr->cr_answer_recv) {
/* Ignore spurious answers after completing O/A */ if (cr->cr_answer_recv > status) {
//LOG3("ignoring duplicate"); LOG3("status is older than previous answer, ignoring");
//sdp = NULL; sdp = NULL;
// we need to make sure its *actually* a dup, so we can't assume for now. return 0;
cr->cr_answer_recv = 0; } else {
goto retry; // we need to make sure its *actually* a dup, so we can't assume for now.
LOG3("multiple answers received, processing");
cr->cr_answer_recv = 0;
goto retry;
}
} }
else if (cr->cr_offer_sent) { else if (cr->cr_offer_sent) {
/* case 1: answer to our offer */ /* case 1: answer to our offer */