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

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

Issue 47283002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/quic_utils_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 (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 <algorithm> 9 #include <algorithm>
10 10
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 // static 225 // static
226 string QuicUtils::TagToString(QuicTag tag) { 226 string QuicUtils::TagToString(QuicTag tag) {
227 char chars[4]; 227 char chars[4];
228 bool ascii = true; 228 bool ascii = true;
229 const QuicTag orig_tag = tag; 229 const QuicTag orig_tag = tag;
230 230
231 for (size_t i = 0; i < sizeof(chars); i++) { 231 for (size_t i = 0; i < sizeof(chars); i++) {
232 chars[i] = tag; 232 chars[i] = tag;
233 if (chars[i] == 0 && i == 3) { 233 if ((chars[i] == 0 || chars[i] == '\xff') && i == 3) {
234 chars[i] = ' '; 234 chars[i] = ' ';
235 } 235 }
236 if (!isprint(static_cast<unsigned char>(chars[i]))) { 236 if (!isprint(static_cast<unsigned char>(chars[i]))) {
237 ascii = false; 237 ascii = false;
238 break; 238 break;
239 } 239 }
240 tag >>= 8; 240 tag >>= 8;
241 } 241 }
242 242
243 if (ascii) { 243 if (ascii) {
(...skipping 29 matching lines...) Expand all
273 273
274 bytes_remaining -= line_bytes; 274 bytes_remaining -= line_bytes;
275 offset += line_bytes; 275 offset += line_bytes;
276 p += line_bytes; 276 p += line_bytes;
277 s += '\n'; 277 s += '\n';
278 } 278 }
279 return s; 279 return s;
280 } 280 }
281 281
282 } // namespace net 282 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/quic_utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698