OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void* data, | 191 void* data, |
192 size_t length, | 192 size_t length, |
193 uint8_t tos, | 193 uint8_t tos, |
194 uint8_t set_df) { | 194 uint8_t set_df) { |
195 SctpDataMediaChannel* channel = static_cast<SctpDataMediaChannel*>(addr); | 195 SctpDataMediaChannel* channel = static_cast<SctpDataMediaChannel*>(addr); |
196 LOG(LS_VERBOSE) << "global OnSctpOutboundPacket():" | 196 LOG(LS_VERBOSE) << "global OnSctpOutboundPacket():" |
197 << "addr: " << addr << "; length: " << length | 197 << "addr: " << addr << "; length: " << length |
198 << "; tos: " << std::hex << static_cast<int>(tos) | 198 << "; tos: " << std::hex << static_cast<int>(tos) |
199 << "; set_df: " << std::hex << static_cast<int>(set_df); | 199 << "; set_df: " << std::hex << static_cast<int>(set_df); |
200 | 200 |
201 VerboseLogPacket(addr, length, SCTP_DUMP_OUTBOUND); | 201 VerboseLogPacket(data, length, SCTP_DUMP_OUTBOUND); |
202 // Note: We have to copy the data; the caller will delete it. | 202 // Note: We have to copy the data; the caller will delete it. |
203 auto* msg = new OutboundPacketMessage( | 203 auto* msg = new OutboundPacketMessage( |
204 new rtc::CopyOnWriteBuffer(reinterpret_cast<uint8_t*>(data), length)); | 204 new rtc::CopyOnWriteBuffer(reinterpret_cast<uint8_t*>(data), length)); |
205 channel->worker_thread()->Post(RTC_FROM_HERE, channel, MSG_SCTPOUTBOUNDPACKET, | 205 channel->worker_thread()->Post(RTC_FROM_HERE, channel, MSG_SCTPOUTBOUNDPACKET, |
206 msg); | 206 msg); |
207 return 0; | 207 return 0; |
208 } | 208 } |
209 | 209 |
210 // This is the callback called from usrsctp when data has been received, after | 210 // This is the callback called from usrsctp when data has been received, after |
211 // a packet has been interpreted and parsed by usrsctp and found to contain | 211 // a packet has been interpreted and parsed by usrsctp and found to contain |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 } | 1068 } |
1069 case MSG_SCTPOUTBOUNDPACKET: { | 1069 case MSG_SCTPOUTBOUNDPACKET: { |
1070 std::unique_ptr<OutboundPacketMessage> pdata( | 1070 std::unique_ptr<OutboundPacketMessage> pdata( |
1071 static_cast<OutboundPacketMessage*>(msg->pdata)); | 1071 static_cast<OutboundPacketMessage*>(msg->pdata)); |
1072 OnPacketFromSctpToNetwork(pdata->data().get()); | 1072 OnPacketFromSctpToNetwork(pdata->data().get()); |
1073 break; | 1073 break; |
1074 } | 1074 } |
1075 } | 1075 } |
1076 } | 1076 } |
1077 } // namespace cricket | 1077 } // namespace cricket |
OLD | NEW |