Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 597 ASSERT(false); | 597 ASSERT(false); |
| 598 port->SendBindingErrorResponse(stun_msg, address, STUN_ERROR_SERVER_ERROR, | 598 port->SendBindingErrorResponse(stun_msg, address, STUN_ERROR_SERVER_ERROR, |
| 599 STUN_ERROR_REASON_SERVER_ERROR); | 599 STUN_ERROR_REASON_SERVER_ERROR); |
| 600 return; | 600 return; |
| 601 } | 601 } |
| 602 | 602 |
| 603 LOG(LS_INFO) << "Adding connection from " | 603 LOG(LS_INFO) << "Adding connection from " |
| 604 << (remote_candidate_is_new ? "peer reflexive" : "resurrected") | 604 << (remote_candidate_is_new ? "peer reflexive" : "resurrected") |
| 605 << " candidate: " << remote_candidate.ToString(); | 605 << " candidate: " << remote_candidate.ToString(); |
| 606 AddConnection(connection); | 606 AddConnection(connection); |
| 607 connection->ReceivedPing(); | 607 connection->HandleBindingRequest(stun_msg); |
|
pthatcher1
2015/11/11 01:19:12
I like this cleanup.
honghaiz3
2015/11/11 19:28:09
Acknowledged.
| |
| 608 | |
| 609 bool received_use_candidate = | |
| 610 stun_msg->GetByteString(STUN_ATTR_USE_CANDIDATE) != nullptr; | |
| 611 if (received_use_candidate && ice_role_ == ICEROLE_CONTROLLED) { | |
| 612 connection->set_nominated(true); | |
| 613 OnNominated(connection); | |
| 614 } | |
| 615 | 608 |
| 616 // Update the list of connections since we just added another. We do this | 609 // Update the list of connections since we just added another. We do this |
| 617 // after sending the response since it could (in principle) delete the | 610 // after sending the response since it could (in principle) delete the |
| 618 // connection in question. | 611 // connection in question. |
| 619 SortConnections(); | 612 SortConnections(); |
| 620 } | 613 } |
| 621 | 614 |
| 622 void P2PTransportChannel::OnRoleConflict(PortInterface* port) { | 615 void P2PTransportChannel::OnRoleConflict(PortInterface* port) { |
| 623 SignalRoleConflict(this); // STUN ping will be sent when SetRole is called | 616 SignalRoleConflict(this); // STUN ping will be sent when SetRole is called |
| 624 // from Transport. | 617 // from Transport. |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1375 SignalSentPacket(this, sent_packet); | 1368 SignalSentPacket(this, sent_packet); |
| 1376 } | 1369 } |
| 1377 | 1370 |
| 1378 void P2PTransportChannel::OnReadyToSend(Connection* connection) { | 1371 void P2PTransportChannel::OnReadyToSend(Connection* connection) { |
| 1379 if (connection == best_connection_ && writable()) { | 1372 if (connection == best_connection_ && writable()) { |
| 1380 SignalReadyToSend(this); | 1373 SignalReadyToSend(this); |
| 1381 } | 1374 } |
| 1382 } | 1375 } |
| 1383 | 1376 |
| 1384 } // namespace cricket | 1377 } // namespace cricket |
| OLD | NEW |