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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 Connection* old_best_connection = best_connection_; | 1156 Connection* old_best_connection = best_connection_; |
1157 best_connection_ = conn; | 1157 best_connection_ = conn; |
1158 if (best_connection_) { | 1158 if (best_connection_) { |
1159 if (old_best_connection) { | 1159 if (old_best_connection) { |
1160 LOG_J(LS_INFO, this) << "Previous best connection: " | 1160 LOG_J(LS_INFO, this) << "Previous best connection: " |
1161 << old_best_connection->ToString(); | 1161 << old_best_connection->ToString(); |
1162 } | 1162 } |
1163 LOG_J(LS_INFO, this) << "New best connection: " | 1163 LOG_J(LS_INFO, this) << "New best connection: " |
1164 << best_connection_->ToString(); | 1164 << best_connection_->ToString(); |
1165 SignalRouteChange(this, best_connection_->remote_candidate()); | 1165 SignalRouteChange(this, best_connection_->remote_candidate()); |
| 1166 // This is a temporary, but safe fix to webrtc issue 5705. |
| 1167 // TODO(honghaiz): Make all EWOULDBLOCK error routed through the transport |
| 1168 // channel so that it knows whether the media channel is allowed to |
| 1169 // send; then it will only signal ready-to-send if the media channel |
| 1170 // has been disallowed to send. |
| 1171 if (best_connection_->writable()) { |
| 1172 SignalReadyToSend(this); |
| 1173 } |
1166 } else { | 1174 } else { |
1167 LOG_J(LS_INFO, this) << "No best connection"; | 1175 LOG_J(LS_INFO, this) << "No best connection"; |
1168 } | 1176 } |
1169 // TODO(honghaiz): rename best_connection_ with selected_connection_ or | 1177 // TODO(honghaiz): rename best_connection_ with selected_connection_ or |
1170 // selected_candidate pair_. | 1178 // selected_candidate pair_. |
1171 SignalSelectedCandidatePairChanged(this, best_connection_); | 1179 SignalSelectedCandidatePairChanged(this, best_connection_); |
1172 } | 1180 } |
1173 | 1181 |
1174 // Warning: UpdateState should eventually be called whenever a connection | 1182 // Warning: UpdateState should eventually be called whenever a connection |
1175 // is added, deleted, or the write state of any connection changes so that the | 1183 // is added, deleted, or the write state of any connection changes so that the |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1623 | 1631 |
1624 // During the initial state when nothing has been pinged yet, return the first | 1632 // During the initial state when nothing has been pinged yet, return the first |
1625 // one in the ordered |connections_|. | 1633 // one in the ordered |connections_|. |
1626 return *(std::find_if(connections_.begin(), connections_.end(), | 1634 return *(std::find_if(connections_.begin(), connections_.end(), |
1627 [conn1, conn2](Connection* conn) { | 1635 [conn1, conn2](Connection* conn) { |
1628 return conn == conn1 || conn == conn2; | 1636 return conn == conn1 || conn == conn2; |
1629 })); | 1637 })); |
1630 } | 1638 } |
1631 | 1639 |
1632 } // namespace cricket | 1640 } // namespace cricket |
OLD | NEW |