| 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_framer.h" | 5 #include "net/quic/quic_framer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 if (public_header->version_flag && perspective_ == Perspective::IS_SERVER) { | 968 if (public_header->version_flag && perspective_ == Perspective::IS_SERVER) { |
| 969 QuicTag version_tag; | 969 QuicTag version_tag; |
| 970 if (!reader->ReadUInt32(&version_tag)) { | 970 if (!reader->ReadUInt32(&version_tag)) { |
| 971 set_detailed_error("Unable to read protocol version."); | 971 set_detailed_error("Unable to read protocol version."); |
| 972 return false; | 972 return false; |
| 973 } | 973 } |
| 974 | 974 |
| 975 // If the version from the new packet is the same as the version of this | 975 // If the version from the new packet is the same as the version of this |
| 976 // framer, then the public flags should be set to something we understand. | 976 // framer, then the public flags should be set to something we understand. |
| 977 // If not, this raises an error. | 977 // If not, this raises an error. |
| 978 last_version_tag_ = version_tag; |
| 978 QuicVersion version = QuicTagToQuicVersion(version_tag); | 979 QuicVersion version = QuicTagToQuicVersion(version_tag); |
| 979 if (version == quic_version_ && public_flags > PACKET_PUBLIC_FLAGS_MAX) { | 980 if (version == quic_version_ && public_flags > PACKET_PUBLIC_FLAGS_MAX) { |
| 980 set_detailed_error("Illegal public flags value."); | 981 set_detailed_error("Illegal public flags value."); |
| 981 return false; | 982 return false; |
| 982 } | 983 } |
| 983 public_header->versions.push_back(version); | 984 public_header->versions.push_back(version); |
| 984 } | 985 } |
| 985 return true; | 986 return true; |
| 986 } | 987 } |
| 987 | 988 |
| (...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2307 | 2308 |
| 2308 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2309 bool QuicFramer::RaiseError(QuicErrorCode error) { |
| 2309 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) | 2310 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) |
| 2310 << " detail: " << detailed_error_; | 2311 << " detail: " << detailed_error_; |
| 2311 set_error(error); | 2312 set_error(error); |
| 2312 visitor_->OnError(this); | 2313 visitor_->OnError(this); |
| 2313 return false; | 2314 return false; |
| 2314 } | 2315 } |
| 2315 | 2316 |
| 2316 } // namespace net | 2317 } // namespace net |
| OLD | NEW |