Bug 972592 - Make ICE 400 response strings more verbose for easier debugging. r=bwc
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Tue, 18 Feb 2014 09:58:25 -0500
changeset 169671 31806aaa5ab26bae48c167acb08ea314ac6d1a45
parent 169670 940b00462eb765491c176727f08c59b14f82a450
child 169672 ae95fa9d4450086098434c83075e458eaef13864
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersbwc
bugs972592
milestone30.0a1
Bug 972592 - Make ICE 400 response strings more verbose for easier debugging. r=bwc
media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
--- a/media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
@@ -245,48 +245,48 @@ int nr_stun_server_process_request(nr_st
 
     if ((r=nr_stun_message_create2(&req, (UCHAR*)msg, len)))
         ABORT(r);
 
     if ((r=nr_stun_message_create(&res)))
         ABORT(r);
 
     if ((r=nr_stun_decode_message(req, nr_stun_server_get_password, ctx))) {
-        /* draft-ietf-behave-rfc3489bis-07.txt S 7.3 says "If any errors are
-         * detected, the message is silently discarded."  */
+        /* RFC5389 S 7.3 says "If any errors are detected, the message is
+         * silently discarded."  */
 #ifndef USE_STUN_PEDANTIC
         /* ... but that seems like a bad idea, at least return a 400 so
          * that the server isn't a black hole to the client */
-        nr_stun_form_error_response(req, res, 400, "Bad Request");
+        nr_stun_form_error_response(req, res, 400, "Bad Request - Failed to decode request");
         ABORT(R_ALREADY);
 #endif /* USE_STUN_PEDANTIC */
         ABORT(R_REJECTED);
     }
 
     if ((r=nr_stun_receive_message(0, req))) {
-        /* draft-ietf-behave-rfc3489bis-07.txt S 7.3 says "If any errors are
-         * detected, the message is silently discarded."  */
+        /* RFC5389 S 7.3 says "If any errors are detected, the message is
+         * silently discarded."  */
 #ifndef USE_STUN_PEDANTIC
         /* ... but that seems like a bad idea, at least return a 400 so
          * that the server isn't a black hole to the client */
-        nr_stun_form_error_response(req, res, 400, "Bad Request");
+        nr_stun_form_error_response(req, res, 400, "Bad Request - Section 7.3 check failed");
         ABORT(R_ALREADY);
 #endif /* USE_STUN_PEDANTIC */
         ABORT(R_REJECTED);
     }
 
     if (NR_STUN_GET_TYPE_CLASS(req->header.type) != NR_CLASS_REQUEST
      && NR_STUN_GET_TYPE_CLASS(req->header.type) != NR_CLASS_INDICATION) {
          r_log(NR_LOG_STUN,LOG_WARNING,"STUN-SERVER(%s): Illegal message type: %04x",ctx->label,req->header.type);
-        /* draft-ietf-behave-rfc3489bis-07.txt S 7.3 says "If any errors are
-         * detected, the message is silently discarded."  */
+        /* RFC5389 S 7.3 says "If any errors are detected, the message is
+         * silently discarded."  */
 #ifndef USE_STUN_PEDANTIC
         /* ... but that seems like a bad idea, at least return a 400 so
          * that the server isn't a black hole to the client */
-        nr_stun_form_error_response(req, res, 400, "Bad Request");
+        nr_stun_form_error_response(req, res, 400, "Bad Request - Unsupported message type");
         ABORT(R_ALREADY);
 #endif /* USE_STUN_PEDANTIC */
         ABORT(R_REJECTED);
     }
 
     /* "The STUN agent then does any checks that are required by a
      * authentication mechanism that the usage has specified" */
     if ((r=nr_stun_server_process_request_auth_checks(ctx, req, auth_rule, res)))