summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormallinath@chromium.org <mallinath@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 21:14:06 +0000
committermallinath@chromium.org <mallinath@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 21:14:06 +0000
commit2c8cf3f7c0208cb4912725fe2c7eaa5702d42a18 (patch)
treeec49f7481582614c1f0e2efef15690f01a410b3e
parent9fe42045f001725cb3915deb53d45fa2dfb573ed (diff)
downloadchromium_src-2c8cf3f7c0208cb4912725fe2c7eaa5702d42a18.zip
chromium_src-2c8cf3f7c0208cb4912725fe2c7eaa5702d42a18.tar.gz
chromium_src-2c8cf3f7c0208cb4912725fe2c7eaa5702d42a18.tar.bz2
Don't try to set DSCP on socket when outgoing packet DSCP
value is set to DSCP_NO_CHANGE. Libjingle, in certain cases can send packets on to the network before it's configured on all cricket::Ports, which send packets to the network. One such case is STUN binding requests. If any clients start with NO_CHANGE, they will not be able to do any future modications. This change will allow such cases. Review URL: https://codereview.chromium.org/47513019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231642 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/renderer_host/p2p/socket_host_udp.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/content/browser/renderer_host/p2p/socket_host_udp.cc b/content/browser/renderer_host/p2p/socket_host_udp.cc
index d0269b4..e199d94 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -202,7 +202,12 @@ void P2PSocketHostUdp::Send(const net::IPEndPoint& to,
void P2PSocketHostUdp::DoSend(const PendingPacket& packet) {
TRACE_EVENT_ASYNC_STEP_INTO1("p2p", "Send", packet.id, "UdpAsyncSendTo",
"size", packet.size);
- if (last_dscp_ != packet.dscp && last_dscp_ != net::DSCP_NO_CHANGE) {
+ // Don't try to set DSCP in following conditions,
+ // 1. If the outgoing packet is set to DSCP_NO_CHANGE
+ // 2. If no change in DSCP value from last packet
+ // 3. If there is any error in setting DSCP on socket.
+ if (packet.dscp != net::DSCP_NO_CHANGE &&
+ last_dscp_ != packet.dscp && last_dscp_ != net::DSCP_NO_CHANGE) {
int result = socket_->SetDiffServCodePoint(packet.dscp);
if (result == net::OK) {
last_dscp_ = packet.dscp;