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 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 QuicDataWriter* writer) { | 1952 QuicDataWriter* writer) { |
1953 if (!writer->WriteBytes(&frame.stream_id, GetStreamIdSize(frame.stream_id))) { | 1953 if (!writer->WriteBytes(&frame.stream_id, GetStreamIdSize(frame.stream_id))) { |
1954 LOG(DFATAL) << "Writing stream id size failed."; | 1954 LOG(DFATAL) << "Writing stream id size failed."; |
1955 return false; | 1955 return false; |
1956 } | 1956 } |
1957 if (!writer->WriteBytes(&frame.offset, GetStreamOffsetSize(frame.offset))) { | 1957 if (!writer->WriteBytes(&frame.offset, GetStreamOffsetSize(frame.offset))) { |
1958 LOG(DFATAL) << "Writing offset size failed."; | 1958 LOG(DFATAL) << "Writing offset size failed."; |
1959 return false; | 1959 return false; |
1960 } | 1960 } |
1961 if (!no_stream_frame_length) { | 1961 if (!no_stream_frame_length) { |
1962 if ((frame.data.TotalBufferSize() > std::numeric_limits<uint16>::max()) || | 1962 if ((frame.data.TotalBufferSize() > numeric_limits<uint16>::max()) || |
1963 !writer->WriteUInt16( | 1963 !writer->WriteUInt16( |
1964 static_cast<uint16>(frame.data.TotalBufferSize()))) { | 1964 static_cast<uint16>(frame.data.TotalBufferSize()))) { |
1965 LOG(DFATAL) << "Writing stream frame length failed"; | 1965 LOG(DFATAL) << "Writing stream frame length failed"; |
1966 return false; | 1966 return false; |
1967 } | 1967 } |
1968 } | 1968 } |
1969 | 1969 |
1970 if (!writer->WriteIOVector(frame.data)) { | 1970 if (!writer->WriteIOVector(frame.data)) { |
1971 LOG(DFATAL) << "Writing frame data failed."; | 1971 LOG(DFATAL) << "Writing frame data failed."; |
1972 return false; | 1972 return false; |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2319 | 2319 |
2320 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2320 bool QuicFramer::RaiseError(QuicErrorCode error) { |
2321 DVLOG(1) << "Error detail: " << detailed_error_; | 2321 DVLOG(1) << "Error detail: " << detailed_error_; |
2322 set_error(error); | 2322 set_error(error); |
2323 visitor_->OnError(this); | 2323 visitor_->OnError(this); |
2324 reader_.reset(nullptr); | 2324 reader_.reset(nullptr); |
2325 return false; | 2325 return false; |
2326 } | 2326 } |
2327 | 2327 |
2328 } // namespace net | 2328 } // namespace net |
OLD | NEW |