Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: webrtc/pc/peerconnection.cc

Issue 2680023005: Clarifying error messages in ParseIceServerUrl for invalid transport parameters. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/pc/peerconnection_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection.cc
diff --git a/webrtc/pc/peerconnection.cc b/webrtc/pc/peerconnection.cc
index ba21429d8585fe1d43fe68b0f478c0a623eef89e..ee04d8e9617614ecedccf57034ad5fe30ce5258e 100644
--- a/webrtc/pc/peerconnection.cc
+++ b/webrtc/pc/peerconnection.cc
@@ -245,11 +245,14 @@ RTCErrorType ParseIceServerUrl(
LOG(LS_WARNING) << "Invalid transport parameter key.";
return RTCErrorType::SYNTAX_ERROR;
}
- if (tokens.size() < 2 ||
- !cricket::StringToProto(tokens[1].c_str(), &turn_transport_type) ||
+ if (tokens.size() < 2) {
+ LOG(LS_WARNING) << "Transport parameter missing value.";
+ return RTCErrorType::SYNTAX_ERROR;
+ }
+ if (!cricket::StringToProto(tokens[1].c_str(), &turn_transport_type) ||
(turn_transport_type != cricket::PROTO_UDP &&
turn_transport_type != cricket::PROTO_TCP)) {
- LOG(LS_WARNING) << "Transport param should always be udp or tcp.";
+ LOG(LS_WARNING) << "Transport parameter should always be udp or tcp.";
return RTCErrorType::SYNTAX_ERROR;
}
}
« no previous file with comments | « no previous file | webrtc/pc/peerconnection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698