| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 const rtc::PacketOptions& options, | 511 const rtc::PacketOptions& options, |
| 512 bool payload) { | 512 bool payload) { |
| 513 // Try to find an entry for this specific address; we should have one. | 513 // Try to find an entry for this specific address; we should have one. |
| 514 TurnEntry* entry = FindEntry(addr); | 514 TurnEntry* entry = FindEntry(addr); |
| 515 if (!entry) { | 515 if (!entry) { |
| 516 LOG(LS_ERROR) << "Did not find the TurnEntry for address " << addr; | 516 LOG(LS_ERROR) << "Did not find the TurnEntry for address " << addr; |
| 517 return 0; | 517 return 0; |
| 518 } | 518 } |
| 519 | 519 |
| 520 if (!ready()) { | 520 if (!ready()) { |
| 521 error_ = EWOULDBLOCK; | 521 error_ = ENOTCONN; |
| 522 return SOCKET_ERROR; | 522 return SOCKET_ERROR; |
| 523 } | 523 } |
| 524 | 524 |
| 525 // Send the actual contents to the server using the usual mechanism. | 525 // Send the actual contents to the server using the usual mechanism. |
| 526 int sent = entry->Send(data, size, payload, options); | 526 int sent = entry->Send(data, size, payload, options); |
| 527 if (sent <= 0) { | 527 if (sent <= 0) { |
| 528 return SOCKET_ERROR; | 528 return SOCKET_ERROR; |
| 529 } | 529 } |
| 530 | 530 |
| 531 // The caller of the function is expecting the number of user data bytes, | 531 // The caller of the function is expecting the number of user data bytes, |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 } else { | 1534 } else { |
| 1535 state_ = STATE_UNBOUND; | 1535 state_ = STATE_UNBOUND; |
| 1536 port_->FailAndPruneConnection(ext_addr_); | 1536 port_->FailAndPruneConnection(ext_addr_); |
| 1537 } | 1537 } |
| 1538 } | 1538 } |
| 1539 void TurnEntry::OnChannelBindTimeout() { | 1539 void TurnEntry::OnChannelBindTimeout() { |
| 1540 state_ = STATE_UNBOUND; | 1540 state_ = STATE_UNBOUND; |
| 1541 port_->FailAndPruneConnection(ext_addr_); | 1541 port_->FailAndPruneConnection(ext_addr_); |
| 1542 } | 1542 } |
| 1543 } // namespace cricket | 1543 } // namespace cricket |
| OLD | NEW |