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

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

Issue 1548783002: Adding details to most quic connection close calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110540464
Patch Set: Created 5 years 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_crypto_stream_test.cc ('k') | net/quic/quic_flow_controller_test.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_flow_controller.h" 5 #include "net/quic/quic_flow_controller.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/strings/stringprintf.h"
8 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
9 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_protocol.h" 11 #include "net/quic/quic_protocol.h"
11 12
12 namespace net { 13 namespace net {
13 14
14 #define ENDPOINT \ 15 #define ENDPOINT \
15 (perspective_ == Perspective::IS_SERVER ? "Server: " : "Client: ") 16 (perspective_ == Perspective::IS_SERVER ? "Server: " : "Client: ")
16 17
17 QuicFlowController::QuicFlowController(QuicConnection* connection, 18 QuicFlowController::QuicFlowController(QuicConnection* connection,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 67 }
67 68
68 void QuicFlowController::AddBytesSent(QuicByteCount bytes_sent) { 69 void QuicFlowController::AddBytesSent(QuicByteCount bytes_sent) {
69 if (bytes_sent_ + bytes_sent > send_window_offset_) { 70 if (bytes_sent_ + bytes_sent > send_window_offset_) {
70 LOG(DFATAL) << ENDPOINT << "Stream " << id_ << " Trying to send an extra " 71 LOG(DFATAL) << ENDPOINT << "Stream " << id_ << " Trying to send an extra "
71 << bytes_sent << " bytes, when bytes_sent = " << bytes_sent_ 72 << bytes_sent << " bytes, when bytes_sent = " << bytes_sent_
72 << ", and send_window_offset_ = " << send_window_offset_; 73 << ", and send_window_offset_ = " << send_window_offset_;
73 bytes_sent_ = send_window_offset_; 74 bytes_sent_ = send_window_offset_;
74 75
75 // This is an error on our side, close the connection as soon as possible. 76 // This is an error on our side, close the connection as soon as possible.
76 connection_->SendConnectionClose(QUIC_FLOW_CONTROL_SENT_TOO_MUCH_DATA); 77 connection_->SendConnectionCloseWithDetails(
78 QUIC_FLOW_CONTROL_SENT_TOO_MUCH_DATA,
79 base::StringPrintf("%lu bytes over send window offset",
80 send_window_offset_ - (bytes_sent_ + bytes_sent))
81 .c_str());
77 return; 82 return;
78 } 83 }
79 84
80 bytes_sent_ += bytes_sent; 85 bytes_sent_ += bytes_sent;
81 DVLOG(1) << ENDPOINT << "Stream " << id_ << " sent: " << bytes_sent_; 86 DVLOG(1) << ENDPOINT << "Stream " << id_ << " sent: " << bytes_sent_;
82 } 87 }
83 88
84 bool QuicFlowController::FlowControlViolation() { 89 bool QuicFlowController::FlowControlViolation() {
85 if (highest_received_byte_offset_ > receive_window_offset_) { 90 if (highest_received_byte_offset_ > receive_window_offset_) {
86 LOG(ERROR) << ENDPOINT << "Flow control violation on stream " 91 LOG(ERROR) << ENDPOINT << "Flow control violation on stream "
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 if (receive_window_size_ != receive_window_offset_) { 247 if (receive_window_size_ != receive_window_offset_) {
243 LOG(DFATAL) << "receive_window_size_:" << receive_window_size_ 248 LOG(DFATAL) << "receive_window_size_:" << receive_window_size_
244 << " != receive_window_offset:" << receive_window_offset_; 249 << " != receive_window_offset:" << receive_window_offset_;
245 return; 250 return;
246 } 251 }
247 receive_window_size_ = size; 252 receive_window_size_ = size;
248 receive_window_offset_ = size; 253 receive_window_offset_ = size;
249 } 254 }
250 255
251 } // namespace net 256 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_stream_test.cc ('k') | net/quic/quic_flow_controller_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698