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

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

Issue 23597045: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged QuicPriority to RequestPriority changes Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/reliable_quic_stream.h » ('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_utils.h" 5 #include "net/quic/quic_utils.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/port.h" 10 #include "base/port.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 #define RETURN_STRING_LITERAL(x) \ 114 #define RETURN_STRING_LITERAL(x) \
115 case x: \ 115 case x: \
116 return #x; 116 return #x;
117 117
118 // static 118 // static
119 const char* QuicUtils::StreamErrorToString(QuicRstStreamErrorCode error) { 119 const char* QuicUtils::StreamErrorToString(QuicRstStreamErrorCode error) {
120 switch (error) { 120 switch (error) {
121 RETURN_STRING_LITERAL(QUIC_STREAM_NO_ERROR); 121 RETURN_STRING_LITERAL(QUIC_STREAM_NO_ERROR);
122 RETURN_STRING_LITERAL(QUIC_STREAM_CONNECTION_ERROR); 122 RETURN_STRING_LITERAL(QUIC_STREAM_CONNECTION_ERROR);
123 RETURN_STRING_LITERAL(QUIC_SERVER_ERROR_PROCESSING_STREAM); 123 RETURN_STRING_LITERAL(QUIC_ERROR_PROCESSING_STREAM);
124 RETURN_STRING_LITERAL(QUIC_MULTIPLE_TERMINATION_OFFSETS); 124 RETURN_STRING_LITERAL(QUIC_MULTIPLE_TERMINATION_OFFSETS);
125 RETURN_STRING_LITERAL(QUIC_BAD_APPLICATION_PAYLOAD); 125 RETURN_STRING_LITERAL(QUIC_BAD_APPLICATION_PAYLOAD);
126 RETURN_STRING_LITERAL(QUIC_STREAM_PEER_GOING_AWAY); 126 RETURN_STRING_LITERAL(QUIC_STREAM_PEER_GOING_AWAY);
127 RETURN_STRING_LITERAL(QUIC_STREAM_CANCELLED); 127 RETURN_STRING_LITERAL(QUIC_STREAM_CANCELLED);
128 RETURN_STRING_LITERAL(QUIC_STREAM_LAST_ERROR); 128 RETURN_STRING_LITERAL(QUIC_STREAM_LAST_ERROR);
129 } 129 }
130 // Return a default value so that we return this when |error| doesn't match 130 // Return a default value so that we return this when |error| doesn't match
131 // any of the QuicRstStreamErrorCodes. This can happen when the RstStream 131 // any of the QuicRstStreamErrorCodes. This can happen when the RstStream
132 // frame sent by the peer (attacker) has invalid error code. 132 // frame sent by the peer (attacker) has invalid error code.
133 return "INVALID_RST_STREAM_ERROR_CODE"; 133 return "INVALID_RST_STREAM_ERROR_CODE";
(...skipping 30 matching lines...) Expand all
164 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); 164 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE);
165 RETURN_STRING_LITERAL(QUIC_CRYPTO_INTERNAL_ERROR); 165 RETURN_STRING_LITERAL(QUIC_CRYPTO_INTERNAL_ERROR);
166 RETURN_STRING_LITERAL(QUIC_CRYPTO_VERSION_NOT_SUPPORTED); 166 RETURN_STRING_LITERAL(QUIC_CRYPTO_VERSION_NOT_SUPPORTED);
167 RETURN_STRING_LITERAL(QUIC_CRYPTO_NO_SUPPORT); 167 RETURN_STRING_LITERAL(QUIC_CRYPTO_NO_SUPPORT);
168 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_TYPE); 168 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_TYPE);
169 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER); 169 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER);
170 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND); 170 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND);
171 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NO_OVERLAP); 171 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NO_OVERLAP);
172 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_INDEX_NOT_FOUND); 172 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_INDEX_NOT_FOUND);
173 RETURN_STRING_LITERAL(QUIC_INVALID_STREAM_ID); 173 RETURN_STRING_LITERAL(QUIC_INVALID_STREAM_ID);
174 RETURN_STRING_LITERAL(QUIC_INVALID_PRIORITY);
174 RETURN_STRING_LITERAL(QUIC_TOO_MANY_OPEN_STREAMS); 175 RETURN_STRING_LITERAL(QUIC_TOO_MANY_OPEN_STREAMS);
175 RETURN_STRING_LITERAL(QUIC_PUBLIC_RESET); 176 RETURN_STRING_LITERAL(QUIC_PUBLIC_RESET);
176 RETURN_STRING_LITERAL(QUIC_INVALID_VERSION); 177 RETURN_STRING_LITERAL(QUIC_INVALID_VERSION);
177 RETURN_STRING_LITERAL(QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED); 178 RETURN_STRING_LITERAL(QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED);
178 RETURN_STRING_LITERAL(QUIC_INVALID_HEADER_ID); 179 RETURN_STRING_LITERAL(QUIC_INVALID_HEADER_ID);
179 RETURN_STRING_LITERAL(QUIC_INVALID_NEGOTIATED_VALUE); 180 RETURN_STRING_LITERAL(QUIC_INVALID_NEGOTIATED_VALUE);
180 RETURN_STRING_LITERAL(QUIC_DECOMPRESSION_FAILURE); 181 RETURN_STRING_LITERAL(QUIC_DECOMPRESSION_FAILURE);
181 RETURN_STRING_LITERAL(QUIC_CONNECTION_TIMED_OUT); 182 RETURN_STRING_LITERAL(QUIC_CONNECTION_TIMED_OUT);
182 RETURN_STRING_LITERAL(QUIC_ERROR_MIGRATING_ADDRESS); 183 RETURN_STRING_LITERAL(QUIC_ERROR_MIGRATING_ADDRESS);
183 RETURN_STRING_LITERAL(QUIC_PACKET_WRITE_ERROR); 184 RETURN_STRING_LITERAL(QUIC_PACKET_WRITE_ERROR);
184 RETURN_STRING_LITERAL(QUIC_PACKET_READ_ERROR); 185 RETURN_STRING_LITERAL(QUIC_PACKET_READ_ERROR);
186 RETURN_STRING_LITERAL(QUIC_INVALID_STREAM_FRAME);
185 RETURN_STRING_LITERAL(QUIC_PROOF_INVALID); 187 RETURN_STRING_LITERAL(QUIC_PROOF_INVALID);
186 RETURN_STRING_LITERAL(QUIC_CRYPTO_DUPLICATE_TAG); 188 RETURN_STRING_LITERAL(QUIC_CRYPTO_DUPLICATE_TAG);
187 RETURN_STRING_LITERAL(QUIC_CRYPTO_ENCRYPTION_LEVEL_INCORRECT); 189 RETURN_STRING_LITERAL(QUIC_CRYPTO_ENCRYPTION_LEVEL_INCORRECT);
188 RETURN_STRING_LITERAL(QUIC_CRYPTO_SERVER_CONFIG_EXPIRED); 190 RETURN_STRING_LITERAL(QUIC_CRYPTO_SERVER_CONFIG_EXPIRED);
189 RETURN_STRING_LITERAL(QUIC_LAST_ERROR); 191 RETURN_STRING_LITERAL(QUIC_LAST_ERROR);
190 // Intentionally have no default case, so we'll break the build 192 // Intentionally have no default case, so we'll break the build
191 // if we add errors and don't put them here. 193 // if we add errors and don't put them here.
192 } 194 }
193 // Return a default value so that we return this when |error| doesn't match 195 // Return a default value so that we return this when |error| doesn't match
194 // any of the QuicErrorCodes. This can happen when the ConnectionClose 196 // any of the QuicErrorCodes. This can happen when the ConnectionClose
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 260
259 bytes_remaining -= line_bytes; 261 bytes_remaining -= line_bytes;
260 offset += line_bytes; 262 offset += line_bytes;
261 p += line_bytes; 263 p += line_bytes;
262 s += '\n'; 264 s += '\n';
263 } 265 }
264 return s; 266 return s;
265 } 267 }
266 268
267 } // namespace net 269 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698