Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: net/quic/quic_stream_sequencer.cc

Issue 1983183002: Landing Recent QUIC changes until 5/14/2016 02:25:25 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "first try to fix link error for win_clang build" Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_spdy_stream_test.cc ('k') | net/quic/quic_stream_sequencer_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_stream_sequencer.h" 5 #include "net/quic/quic_stream_sequencer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/string_number_conversions.h"
13 #include "net/quic/quic_bug_tracker.h" 14 #include "net/quic/quic_bug_tracker.h"
14 #include "net/quic/quic_clock.h" 15 #include "net/quic/quic_clock.h"
15 #include "net/quic/quic_flags.h" 16 #include "net/quic/quic_flags.h"
16 #include "net/quic/quic_protocol.h" 17 #include "net/quic/quic_protocol.h"
17 #include "net/quic/quic_stream_sequencer_buffer.h" 18 #include "net/quic/quic_stream_sequencer_buffer.h"
18 #include "net/quic/quic_utils.h" 19 #include "net/quic/quic_utils.h"
19 #include "net/quic/reliable_quic_stream.h" 20 #include "net/quic/reliable_quic_stream.h"
20 21
21 using base::StringPiece; 22 using base::StringPiece;
22 using std::min; 23 using std::min;
(...skipping 26 matching lines...) Expand all
49 if (data_len == 0) { 50 if (data_len == 0) {
50 return; 51 return;
51 } 52 }
52 } 53 }
53 size_t bytes_written; 54 size_t bytes_written;
54 string error_details; 55 string error_details;
55 QuicErrorCode result = buffered_frames_.OnStreamData( 56 QuicErrorCode result = buffered_frames_.OnStreamData(
56 byte_offset, StringPiece(frame.data_buffer, frame.data_length), 57 byte_offset, StringPiece(frame.data_buffer, frame.data_length),
57 clock_->ApproximateNow(), &bytes_written, &error_details); 58 clock_->ApproximateNow(), &bytes_written, &error_details);
58 if (result != QUIC_NO_ERROR) { 59 if (result != QUIC_NO_ERROR) {
60 string details = "Stream" + base::Uint64ToString(stream_->id()) + ": " +
61 QuicUtils::ErrorToString(result) + ": " + error_details +
62 "\nPeer Address: " +
63 stream_->PeerAddressOfLatestPacket().ToString();
59 DLOG(WARNING) << QuicUtils::ErrorToString(result); 64 DLOG(WARNING) << QuicUtils::ErrorToString(result);
60 DLOG(WARNING) << error_details; 65 DLOG(WARNING) << details;
61 stream_->CloseConnectionWithDetails(result, error_details); 66 stream_->CloseConnectionWithDetails(result, details);
62 return; 67 return;
63 } 68 }
64 69
65 if (bytes_written == 0) { 70 if (bytes_written == 0) {
66 ++num_duplicate_frames_received_; 71 ++num_duplicate_frames_received_;
67 // Silently ignore duplicates. 72 // Silently ignore duplicates.
68 return; 73 return;
69 } 74 }
70 75
71 if (byte_offset > buffered_frames_.BytesConsumed()) { 76 if (byte_offset > buffered_frames_.BytesConsumed()) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 196
192 size_t QuicStreamSequencer::NumBytesBuffered() const { 197 size_t QuicStreamSequencer::NumBytesBuffered() const {
193 return buffered_frames_.BytesBuffered(); 198 return buffered_frames_.BytesBuffered();
194 } 199 }
195 200
196 QuicStreamOffset QuicStreamSequencer::NumBytesConsumed() const { 201 QuicStreamOffset QuicStreamSequencer::NumBytesConsumed() const {
197 return buffered_frames_.BytesConsumed(); 202 return buffered_frames_.BytesConsumed();
198 } 203 }
199 204
200 } // namespace net 205 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_spdy_stream_test.cc ('k') | net/quic/quic_stream_sequencer_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698