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

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

Issue 641183008: merge to m39: Fix a bug where QUIC connections would not fallback to TCP if the connection fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2171
Patch Set: Created 6 years, 1 month 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_reliable_client_stream.h ('k') | no next file » | 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_reliable_client_stream.h" 5 #include "net/quic/quic_reliable_client_stream.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/quic/quic_session.h" 9 #include "net/quic/quic_session.h"
10 #include "net/quic/quic_write_blocked_list.h" 10 #include "net/quic/quic_write_blocked_list.h"
(...skipping 24 matching lines...) Expand all
35 35
36 int rv = delegate_->OnDataReceived(data, data_len); 36 int rv = delegate_->OnDataReceived(data, data_len);
37 if (rv != OK) { 37 if (rv != OK) {
38 DLOG(ERROR) << "Delegate refused data, rv: " << rv; 38 DLOG(ERROR) << "Delegate refused data, rv: " << rv;
39 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 39 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
40 return 0; 40 return 0;
41 } 41 }
42 return data_len; 42 return data_len;
43 } 43 }
44 44
45 void QuicReliableClientStream::OnFinRead() { 45 void QuicReliableClientStream::OnClose() {
46 if (delegate_) { 46 if (delegate_) {
47 delegate_->OnClose(connection_error()); 47 delegate_->OnClose(connection_error());
48 delegate_ = NULL; 48 delegate_ = NULL;
49 } 49 }
50 ReliableQuicStream::OnFinRead(); 50 ReliableQuicStream::OnClose();
51 } 51 }
52 52
53 void QuicReliableClientStream::OnCanWrite() { 53 void QuicReliableClientStream::OnCanWrite() {
54 ReliableQuicStream::OnCanWrite(); 54 ReliableQuicStream::OnCanWrite();
55 55
56 if (!HasBufferedData() && !callback_.is_null()) { 56 if (!HasBufferedData() && !callback_.is_null()) {
57 base::ResetAndReturn(&callback_).Run(OK); 57 base::ResetAndReturn(&callback_).Run(OK);
58 } 58 }
59 } 59 }
60 60
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 bool can_write = session()->connection()->CanWrite(HAS_RETRANSMITTABLE_DATA); 99 bool can_write = session()->connection()->CanWrite(HAS_RETRANSMITTABLE_DATA);
100 if (!can_write) { 100 if (!can_write) {
101 session()->MarkWriteBlocked(id(), EffectivePriority()); 101 session()->MarkWriteBlocked(id(), EffectivePriority());
102 DCHECK(callback_.is_null()); 102 DCHECK(callback_.is_null());
103 callback_ = callback; 103 callback_ = callback;
104 } 104 }
105 return can_write; 105 return can_write;
106 } 106 }
107 107
108 } // namespace net 108 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_reliable_client_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698