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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 if (len > 0) { | 566 if (len > 0) { |
567 m_lastsend = now; | 567 m_lastsend = now; |
568 } | 568 } |
569 m_lasttraffic = now; | 569 m_lasttraffic = now; |
570 m_bOutgoing = true; | 570 m_bOutgoing = true; |
571 | 571 |
572 return IPseudoTcpNotify::WR_SUCCESS; | 572 return IPseudoTcpNotify::WR_SUCCESS; |
573 } | 573 } |
574 | 574 |
575 bool PseudoTcp::parse(const uint8_t* buffer, uint32_t size) { | 575 bool PseudoTcp::parse(const uint8_t* buffer, uint32_t size) { |
576 if (size < 12) | 576 if (size < HEADER_SIZE) |
577 return false; | 577 return false; |
578 | 578 |
579 Segment seg; | 579 Segment seg; |
580 seg.conv = bytes_to_long(buffer); | 580 seg.conv = bytes_to_long(buffer); |
581 seg.seq = bytes_to_long(buffer + 4); | 581 seg.seq = bytes_to_long(buffer + 4); |
582 seg.ack = bytes_to_long(buffer + 8); | 582 seg.ack = bytes_to_long(buffer + 8); |
583 seg.flags = buffer[13]; | 583 seg.flags = buffer[13]; |
584 seg.wnd = bytes_to_short(buffer + 14); | 584 seg.wnd = bytes_to_short(buffer + 14); |
585 | 585 |
586 seg.tsval = bytes_to_long(buffer + 16); | 586 seg.tsval = bytes_to_long(buffer + 16); |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 m_rbuf_len = new_size; | 1277 m_rbuf_len = new_size; |
1278 m_rwnd_scale = scale_factor; | 1278 m_rwnd_scale = scale_factor; |
1279 m_ssthresh = new_size; | 1279 m_ssthresh = new_size; |
1280 | 1280 |
1281 size_t available_space = 0; | 1281 size_t available_space = 0; |
1282 m_rbuf.GetWriteRemaining(&available_space); | 1282 m_rbuf.GetWriteRemaining(&available_space); |
1283 m_rcv_wnd = static_cast<uint32_t>(available_space); | 1283 m_rcv_wnd = static_cast<uint32_t>(available_space); |
1284 } | 1284 } |
1285 | 1285 |
1286 } // namespace cricket | 1286 } // namespace cricket |
OLD | NEW |