Silence pointless LS_WARNING about port 0 for active-only candidates.

R=mallinath@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/10899004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5808 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org 2014-03-28 18:13:34 +00:00
parent 987f2c9aae
commit 4f2bd68744
2 changed files with 10 additions and 2 deletions

View File

@ -1397,7 +1397,9 @@ bool WebRtcSession::UseCandidate(
}
// TODO(bemasc): If state is Completed, go back to Connected.
} else {
LOG(LS_WARNING) << error;
if (!error.empty()) {
LOG(LS_WARNING) << error;
}
}
return true;
}

View File

@ -1,6 +1,6 @@
/*
* libjingle
* Copyright 2004--2005, Google Inc.
* Copyright 2004, Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -405,6 +405,12 @@ bool Transport::VerifyCandidate(const Candidate& cand, std::string* error) {
// Disallow all ports below 1024, except for 80 and 443 on public addresses.
int port = cand.address().port();
if (port == 0) {
// Expected for active-only candidates per
// http://tools.ietf.org/html/rfc6544#section-4.5 so no error.
*error = "";
return false;
}
if (port < 1024) {
if ((port != 80) && (port != 443)) {
*error = "candidate has port below 1024, but not 80 or 443";