| 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 "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
| 10 #include "net/quic/crypto/crypto_handshake_message.h" | 10 #include "net/quic/crypto/crypto_handshake_message.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 << QuicVersionToString(quic_version_); | 387 << QuicVersionToString(quic_version_); |
| 388 return kNoPacket; | 388 return kNoPacket; |
| 389 } | 389 } |
| 390 if (!AppendStopWaitingFrame( | 390 if (!AppendStopWaitingFrame( |
| 391 header, *frame.stop_waiting_frame, &writer)) { | 391 header, *frame.stop_waiting_frame, &writer)) { |
| 392 LOG(DFATAL) << "AppendStopWaitingFrame failed"; | 392 LOG(DFATAL) << "AppendStopWaitingFrame failed"; |
| 393 return kNoPacket; | 393 return kNoPacket; |
| 394 } | 394 } |
| 395 break; | 395 break; |
| 396 case PING_FRAME: | 396 case PING_FRAME: |
| 397 if (quic_version_ <= QUIC_VERSION_17) { | 397 if (quic_version_ <= QUIC_VERSION_16) { |
| 398 LOG(DFATAL) << "Attempt to add a PingFrame in " | 398 LOG(DFATAL) << "Attempt to add a PingFrame in " |
| 399 << QuicVersionToString(quic_version_); | 399 << QuicVersionToString(quic_version_); |
| 400 return kNoPacket; | 400 return kNoPacket; |
| 401 } | 401 } |
| 402 // Ping has no payload. | 402 // Ping has no payload. |
| 403 break; | 403 break; |
| 404 case RST_STREAM_FRAME: | 404 case RST_STREAM_FRAME: |
| 405 if (!AppendRstStreamFrame(*frame.rst_stream_frame, &writer)) { | 405 if (!AppendRstStreamFrame(*frame.rst_stream_frame, &writer)) { |
| 406 LOG(DFATAL) << "AppendRstStreamFrame failed"; | 406 LOG(DFATAL) << "AppendRstStreamFrame failed"; |
| 407 return kNoPacket; | 407 return kNoPacket; |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 return RaiseError(QUIC_INVALID_STOP_WAITING_DATA); | 1229 return RaiseError(QUIC_INVALID_STOP_WAITING_DATA); |
| 1230 } | 1230 } |
| 1231 if (!visitor_->OnStopWaitingFrame(stop_waiting_frame)) { | 1231 if (!visitor_->OnStopWaitingFrame(stop_waiting_frame)) { |
| 1232 DVLOG(1) << "Visitor asked to stop further processing."; | 1232 DVLOG(1) << "Visitor asked to stop further processing."; |
| 1233 // Returning true since there was no parsing error. | 1233 // Returning true since there was no parsing error. |
| 1234 return true; | 1234 return true; |
| 1235 } | 1235 } |
| 1236 continue; | 1236 continue; |
| 1237 } | 1237 } |
| 1238 case PING_FRAME: { | 1238 case PING_FRAME: { |
| 1239 if (quic_version_ <= QUIC_VERSION_17) { | 1239 if (quic_version_ <= QUIC_VERSION_16) { |
| 1240 LOG(DFATAL) << "Trying to read a Ping in " | 1240 LOG(DFATAL) << "Trying to read a Ping in " |
| 1241 << QuicVersionToString(quic_version_); | 1241 << QuicVersionToString(quic_version_); |
| 1242 return RaiseError(QUIC_INTERNAL_ERROR); | 1242 return RaiseError(QUIC_INTERNAL_ERROR); |
| 1243 } | 1243 } |
| 1244 // Ping has no payload. | 1244 // Ping has no payload. |
| 1245 QuicPingFrame ping_frame; | 1245 QuicPingFrame ping_frame; |
| 1246 if (!visitor_->OnPingFrame(ping_frame)) { | 1246 if (!visitor_->OnPingFrame(ping_frame)) { |
| 1247 DVLOG(1) << "Visitor asked to stop further processing."; | 1247 DVLOG(1) << "Visitor asked to stop further processing."; |
| 1248 // Returning true since there was no parsing error. | 1248 // Returning true since there was no parsing error. |
| 1249 return true; | 1249 return true; |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2337 | 2337 |
| 2338 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2338 bool QuicFramer::RaiseError(QuicErrorCode error) { |
| 2339 DVLOG(1) << "Error detail: " << detailed_error_; | 2339 DVLOG(1) << "Error detail: " << detailed_error_; |
| 2340 set_error(error); | 2340 set_error(error); |
| 2341 visitor_->OnError(this); | 2341 visitor_->OnError(this); |
| 2342 reader_.reset(NULL); | 2342 reader_.reset(NULL); |
| 2343 return false; | 2343 return false; |
| 2344 } | 2344 } |
| 2345 | 2345 |
| 2346 } // namespace net | 2346 } // namespace net |
| OLD | NEW |