| 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 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 RETURN_STRING_LITERAL(QUIC_BAD_APPLICATION_PAYLOAD); | 194 RETURN_STRING_LITERAL(QUIC_BAD_APPLICATION_PAYLOAD); |
| 195 RETURN_STRING_LITERAL(QUIC_STREAM_PEER_GOING_AWAY); | 195 RETURN_STRING_LITERAL(QUIC_STREAM_PEER_GOING_AWAY); |
| 196 RETURN_STRING_LITERAL(QUIC_STREAM_CANCELLED); | 196 RETURN_STRING_LITERAL(QUIC_STREAM_CANCELLED); |
| 197 RETURN_STRING_LITERAL(QUIC_RST_ACKNOWLEDGEMENT); | 197 RETURN_STRING_LITERAL(QUIC_RST_ACKNOWLEDGEMENT); |
| 198 RETURN_STRING_LITERAL(QUIC_REFUSED_STREAM); | 198 RETURN_STRING_LITERAL(QUIC_REFUSED_STREAM); |
| 199 RETURN_STRING_LITERAL(QUIC_STREAM_LAST_ERROR); | 199 RETURN_STRING_LITERAL(QUIC_STREAM_LAST_ERROR); |
| 200 RETURN_STRING_LITERAL(QUIC_INVALID_PROMISE_URL); | 200 RETURN_STRING_LITERAL(QUIC_INVALID_PROMISE_URL); |
| 201 RETURN_STRING_LITERAL(QUIC_UNAUTHORIZED_PROMISE_URL); | 201 RETURN_STRING_LITERAL(QUIC_UNAUTHORIZED_PROMISE_URL); |
| 202 RETURN_STRING_LITERAL(QUIC_DUPLICATE_PROMISE_URL); | 202 RETURN_STRING_LITERAL(QUIC_DUPLICATE_PROMISE_URL); |
| 203 RETURN_STRING_LITERAL(QUIC_PROMISE_VARY_MISMATCH); | 203 RETURN_STRING_LITERAL(QUIC_PROMISE_VARY_MISMATCH); |
| 204 RETURN_STRING_LITERAL(QUIC_INVALID_PROMISE_METHOD); |
| 204 } | 205 } |
| 205 // Return a default value so that we return this when |error| doesn't match | 206 // Return a default value so that we return this when |error| doesn't match |
| 206 // any of the QuicRstStreamErrorCodes. This can happen when the RstStream | 207 // any of the QuicRstStreamErrorCodes. This can happen when the RstStream |
| 207 // frame sent by the peer (attacker) has invalid error code. | 208 // frame sent by the peer (attacker) has invalid error code. |
| 208 return "INVALID_RST_STREAM_ERROR_CODE"; | 209 return "INVALID_RST_STREAM_ERROR_CODE"; |
| 209 } | 210 } |
| 210 | 211 |
| 211 // static | 212 // static |
| 212 const char* QuicUtils::ErrorToString(QuicErrorCode error) { | 213 const char* QuicUtils::ErrorToString(QuicErrorCode error) { |
| 213 switch (error) { | 214 switch (error) { |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 24)) { | 519 24)) { |
| 519 // Subnet part does not change (here, we use /24), which is considered to be | 520 // Subnet part does not change (here, we use /24), which is considered to be |
| 520 // caused by NATs. | 521 // caused by NATs. |
| 521 return IPV4_SUBNET_CHANGE; | 522 return IPV4_SUBNET_CHANGE; |
| 522 } | 523 } |
| 523 | 524 |
| 524 return UNSPECIFIED_CHANGE; | 525 return UNSPECIFIED_CHANGE; |
| 525 } | 526 } |
| 526 | 527 |
| 527 } // namespace net | 528 } // namespace net |
| OLD | NEW |