| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. and Robin Seggelmann | 3 * Copyright 2012 Google Inc. and Robin Seggelmann |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 << " len=" << buffer->size() << " before SetReceive(true)."; | 722 << " len=" << buffer->size() << " before SetReceive(true)."; |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 | 725 |
| 726 bool SctpDataMediaChannel::AddStream(const StreamParams& stream) { | 726 bool SctpDataMediaChannel::AddStream(const StreamParams& stream) { |
| 727 if (!stream.has_ssrcs()) { | 727 if (!stream.has_ssrcs()) { |
| 728 return false; | 728 return false; |
| 729 } | 729 } |
| 730 | 730 |
| 731 const uint32_t ssrc = stream.first_ssrc(); | 731 const uint32_t ssrc = stream.first_ssrc(); |
| 732 if (open_streams_.find(ssrc) != open_streams_.end()) { | 732 if (ssrc >= cricket::kMaxSctpSid) { |
| 733 LOG(LS_WARNING) << debug_name_ << "->Add(Send|Recv)Stream(...): " | 733 LOG(LS_WARNING) << debug_name_ << "->Add(Send|Recv)Stream(...): " |
| 734 << "Not adding data stream '" << stream.id | 734 << "Not adding data stream '" << stream.id |
| 735 << "' with ssrc=" << ssrc | 735 << "' with ssrc=" << ssrc |
| 736 << " because stream ssrc is too high."; |
| 737 return false; |
| 738 } else if (open_streams_.find(ssrc) != open_streams_.end()) { |
| 739 LOG(LS_WARNING) << debug_name_ << "->Add(Send|Recv)Stream(...): " |
| 740 << "Not adding data stream '" << stream.id |
| 741 << "' with ssrc=" << ssrc |
| 736 << " because stream is already open."; | 742 << " because stream is already open."; |
| 737 return false; | 743 return false; |
| 738 } else if (queued_reset_streams_.find(ssrc) != queued_reset_streams_.end() | 744 } else if (queued_reset_streams_.find(ssrc) != queued_reset_streams_.end() |
| 739 || sent_reset_streams_.find(ssrc) != sent_reset_streams_.end()) { | 745 || sent_reset_streams_.find(ssrc) != sent_reset_streams_.end()) { |
| 740 LOG(LS_WARNING) << debug_name_ << "->Add(Send|Recv)Stream(...): " | 746 LOG(LS_WARNING) << debug_name_ << "->Add(Send|Recv)Stream(...): " |
| 741 << "Not adding data stream '" << stream.id | 747 << "Not adding data stream '" << stream.id |
| 742 << "' with ssrc=" << ssrc | 748 << "' with ssrc=" << ssrc |
| 743 << " because stream is still closing."; | 749 << " because stream is still closing."; |
| 744 return false; | 750 return false; |
| 745 } | 751 } |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 } | 1044 } |
| 1039 case MSG_SCTPOUTBOUNDPACKET: { | 1045 case MSG_SCTPOUTBOUNDPACKET: { |
| 1040 rtc::scoped_ptr<OutboundPacketMessage> pdata( | 1046 rtc::scoped_ptr<OutboundPacketMessage> pdata( |
| 1041 static_cast<OutboundPacketMessage*>(msg->pdata)); | 1047 static_cast<OutboundPacketMessage*>(msg->pdata)); |
| 1042 OnPacketFromSctpToNetwork(pdata->data().get()); | 1048 OnPacketFromSctpToNetwork(pdata->data().get()); |
| 1043 break; | 1049 break; |
| 1044 } | 1050 } |
| 1045 } | 1051 } |
| 1046 } | 1052 } |
| 1047 } // namespace cricket | 1053 } // namespace cricket |
| OLD | NEW |