| OLD | NEW |
| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_SERVER_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_LAST_ERROR); | 128 RETURN_STRING_LITERAL(QUIC_STREAM_LAST_ERROR); |
| 128 } | 129 } |
| 129 // 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 |
| 130 // any of the QuicRstStreamErrorCodes. This can happen when the RstStream | 131 // any of the QuicRstStreamErrorCodes. This can happen when the RstStream |
| 131 // frame sent by the peer (attacker) has invalid error code. | 132 // frame sent by the peer (attacker) has invalid error code. |
| 132 return "INVALID_RST_STREAM_ERROR_CODE"; | 133 return "INVALID_RST_STREAM_ERROR_CODE"; |
| 133 } | 134 } |
| 134 | 135 |
| 135 // static | 136 // static |
| 136 const char* QuicUtils::ErrorToString(QuicErrorCode error) { | 137 const char* QuicUtils::ErrorToString(QuicErrorCode error) { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 257 |
| 257 bytes_remaining -= line_bytes; | 258 bytes_remaining -= line_bytes; |
| 258 offset += line_bytes; | 259 offset += line_bytes; |
| 259 p += line_bytes; | 260 p += line_bytes; |
| 260 s += '\n'; | 261 s += '\n'; |
| 261 } | 262 } |
| 262 return s; | 263 return s; |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace net | 266 } // namespace net |
| OLD | NEW |