Closed Bug 899485 Opened 11 years ago Closed 11 years ago

Have SDP handling return sensible cause codes

Categories

(Core :: WebRTC: Signaling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: abr, Assigned: abr)

Details

Attachments

(1 file, 1 obsolete file)

Currently, most errors that percolate up from SDP generation and
negotiation result in the rather opaque response code CC_CAUSE_ERROR,
which is rendered to web developers as "cause = ERR" in many WebRTC
error callbacks.

To aid in troubleshooting and web developer debugging, these various
failurse should be distinctive, informative error codes.
This patch removes CC_CAUSE_ERROR from gsm_sdp.c almost entierly,
replacing it with more meaningful error responses, most of which
are new. It also updates the two duelling cause-code-to-string
conversion functions, both of which had become pretty badly out
of sync with the cause codes themselves.
Attachment #783026 - Flags: review?(ethanhugg)
Comment on attachment 783026 [details] [diff] [review]
Have SDP handling return sensible cause codes

Review of attachment 783026 [details] [diff] [review]:
-----------------------------------------------------------------

In the new function gsmsdp_check_ice_attributes_exist() there are two returns of CC_CAUSE_ERROR which I think should be now CC_CAUSE_NO_ICE_ATTRIBUTES.  You probably started this patch before that one was in.

::: media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
@@ +1600,5 @@
> +            return result == SDP_INVALID_SDP_PTR ?
> +                       CC_CAUSE_INVALID_SDP_POINTER :
> +                   result == SDP_INVALID_PARAMETER ?
> +                       CC_CAUSE_BAD_ICE_ATTRIBUTE :
> +                   CC_CAUSE_ERROR;

I would indent or paren this to make it a bit clearer.

@@ +6227,5 @@
> +    if ( dcb_p->sdp == NULL || dcb_p->sdp->src_sdp == NULL ) {
> +        cause = gsmsdp_init_local_sdp(dcb_p->peerconnection, &(dcb_p->sdp));
> +        if ( cause != CC_CAUSE_OK) {
> +          return cause;
> +      }

I think this brace should be under the if
Attachment #783026 - Flags: review?(ethanhugg) → review+
Attachment #783026 - Attachment is obsolete: true
Comment on attachment 783634 [details] [diff] [review]
Have SDP handling return sensible cause codes

Carrying forward r+ from ehugg
Attachment #783634 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/e039d1a5523a
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: