Remove IETF QUIC Application Close frame, replace with Connection Close This CL removes the IETF QUIC Application Close frame and replaces it with the Connection Close frame. QuicConnectionCloseFrame::close_type indicates whether the frame is a Google QUIC Connection Close, IETF QUIC Connection Close/Transport or IETF QUIC Connection Close/Application. The QuicFramer::...ApplicationCloseFrame... methods are removed. gfe-relnote: N/A affects only IETF-QUIC/V99 code. Application Close was IETF-QUIC only. PiperOrigin-RevId: 242881293 Change-Id: I783cbf4e5f27d2e5abe3e8b518006de03c815e1a
diff --git a/quic/core/chlo_extractor.cc b/quic/core/chlo_extractor.cc index 355ecd7..b2d11e0 100644 --- a/quic/core/chlo_extractor.cc +++ b/quic/core/chlo_extractor.cc
@@ -52,7 +52,7 @@ bool OnPingFrame(const QuicPingFrame& frame) override; bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override; bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override; - bool OnApplicationCloseFrame(const QuicApplicationCloseFrame& frame) override; + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override; bool OnNewConnectionIdFrame(const QuicNewConnectionIdFrame& frame) override; bool OnRetireConnectionIdFrame( const QuicRetireConnectionIdFrame& frame) override; @@ -212,7 +212,7 @@ } bool ChloFramerVisitor::OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) { + const QuicConnectionCloseFrame& frame) { return true; }
diff --git a/quic/core/frames/quic_application_close_frame.cc b/quic/core/frames/quic_application_close_frame.cc deleted file mode 100644 index 2535655..0000000 --- a/quic/core/frames/quic_application_close_frame.cc +++ /dev/null
@@ -1,19 +0,0 @@ -// Copyright (c) 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "net/third_party/quiche/src/quic/core/frames/quic_application_close_frame.h" - -namespace quic { - -QuicApplicationCloseFrame::QuicApplicationCloseFrame() - : error_code(QUIC_NO_ERROR) {} - -std::ostream& operator<<(std::ostream& os, - const QuicApplicationCloseFrame& frame) { - os << "{ error_code: " << frame.error_code << ", error_details: '" - << frame.error_details << "' }\n"; - return os; -} - -} // namespace quic
diff --git a/quic/core/frames/quic_application_close_frame.h b/quic/core/frames/quic_application_close_frame.h deleted file mode 100644 index 3bb6b87..0000000 --- a/quic/core/frames/quic_application_close_frame.h +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright (c) 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef QUICHE_QUIC_CORE_FRAMES_QUIC_APPLICATION_CLOSE_FRAME_H_ -#define QUICHE_QUIC_CORE_FRAMES_QUIC_APPLICATION_CLOSE_FRAME_H_ - -#include <ostream> -#include <string> - -#include "net/third_party/quiche/src/quic/core/quic_error_codes.h" -#include "net/third_party/quiche/src/quic/platform/api/quic_export.h" - -namespace quic { - -struct QUIC_EXPORT_PRIVATE QuicApplicationCloseFrame { - QuicApplicationCloseFrame(); - - friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( - std::ostream& os, - const QuicApplicationCloseFrame& frame); - - QuicErrorCode error_code; - std::string error_details; -}; - -} // namespace quic - -#endif // QUICHE_QUIC_CORE_FRAMES_QUIC_APPLICATION_CLOSE_FRAME_H_
diff --git a/quic/core/frames/quic_connection_close_frame.cc b/quic/core/frames/quic_connection_close_frame.cc index c4adf56..baffa9d 100644 --- a/quic/core/frames/quic_connection_close_frame.cc +++ b/quic/core/frames/quic_connection_close_frame.cc
@@ -7,20 +7,23 @@ namespace quic { QuicConnectionCloseFrame::QuicConnectionCloseFrame() - : close_type(UNINITIALIZED), + // Default close type ensures that existing, pre-V99 code works as expected. + : close_type(GOOGLE_QUIC_CONNECTION_CLOSE), quic_error_code(QUIC_NO_ERROR), extracted_error_code(QUIC_IETF_GQUIC_ERROR_MISSING), transport_close_frame_type(0) {} QuicConnectionCloseFrame::QuicConnectionCloseFrame(QuicErrorCode error_code) - : close_type(UNINITIALIZED), + // Default close type ensures that existing, pre-V99 code works as expected. + : close_type(GOOGLE_QUIC_CONNECTION_CLOSE), quic_error_code(error_code), extracted_error_code(QUIC_IETF_GQUIC_ERROR_MISSING), transport_close_frame_type(0) {} QuicConnectionCloseFrame::QuicConnectionCloseFrame(QuicErrorCode error_code, std::string error_details) - : close_type(UNINITIALIZED), + // Default close type ensures that existing, pre-V99 code works as expected. + : close_type(GOOGLE_QUIC_CONNECTION_CLOSE), quic_error_code(error_code), extracted_error_code(QUIC_IETF_GQUIC_ERROR_MISSING), error_details(std::move(error_details)), @@ -31,7 +34,8 @@ QuicErrorCode extracted_error_code, std::string error_details, uint64_t transport_close_frame_type) - : close_type(UNINITIALIZED), + // Default close type ensures that existing, pre-V99 code works as expected. + : close_type(GOOGLE_QUIC_CONNECTION_CLOSE), transport_error_code(transport_error_code), extracted_error_code(extracted_error_code), error_details(std::move(error_details)), @@ -59,9 +63,6 @@ std::ostream& operator<<(std::ostream& os, const QuicConnectionCloseType type) { switch (type) { - case UNINITIALIZED: - os << "UNINITIALIZED"; - break; case GOOGLE_QUIC_CONNECTION_CLOSE: os << "GOOGLE_QUIC_CONNECTION_CLOSE"; break;
diff --git a/quic/core/frames/quic_connection_close_frame.h b/quic/core/frames/quic_connection_close_frame.h index 4d0cff7..7997fbc 100644 --- a/quic/core/frames/quic_connection_close_frame.h +++ b/quic/core/frames/quic_connection_close_frame.h
@@ -14,15 +14,11 @@ namespace quic { -// There are three different forms of CONNECTION_CLOSE. UNINITIALIZED is -// included explicitly for the QuicConnectionCloseFrame so that when the object -// is constructed, a valid enumeration, indicating that the type is not known, -// can be set. +// There are three different forms of CONNECTION_CLOSE. typedef enum QuicConnectionCloseType { - UNINITIALIZED = 0, - GOOGLE_QUIC_CONNECTION_CLOSE = 1, - IETF_QUIC_TRANSPORT_CONNECTION_CLOSE = 2, - IETF_QUIC_APPLICATION_CONNECTION_CLOSE = 3 + GOOGLE_QUIC_CONNECTION_CLOSE = 0, + IETF_QUIC_TRANSPORT_CONNECTION_CLOSE = 1, + IETF_QUIC_APPLICATION_CONNECTION_CLOSE = 2 } QuicConnectionCloseType; QUIC_EXPORT_PRIVATE std::ostream& operator<<( std::ostream& os, @@ -42,7 +38,7 @@ const QuicConnectionCloseFrame& c); // Indicates whether the received CONNECTION_CLOSE frame is a Google QUIC - // CONNECTION_CLOSE, IETF QUIC CONNECTION_CLOSE + // CONNECTION_CLOSE, IETF QUIC CONNECTION_CLOSE. QuicConnectionCloseType close_type; // This is the error field in the frame. @@ -62,9 +58,10 @@ // information as to the source of the error. QuicErrorCode extracted_error_code; - // String with additional error details. In some circumstances, we will add a - // "QuicErrorCode: QUIC_...(123)" string indicating a more specific internal - // error code. + // String with additional error details. "QuicErrorCode: 123" will be appended + // to the error details when sending IETF QUIC Connection Close and + // Application Close frames and parsed into extracted_error_code upon receipt, + // when present. std::string error_details; // The frame type present in the IETF transport connection close frame.
diff --git a/quic/core/frames/quic_frame.cc b/quic/core/frames/quic_frame.cc index fbe54cd..95fee41 100644 --- a/quic/core/frames/quic_frame.cc +++ b/quic/core/frames/quic_frame.cc
@@ -45,9 +45,6 @@ QuicFrame::QuicFrame(QuicBlockedFrame* frame) : type(BLOCKED_FRAME), blocked_frame(frame) {} -QuicFrame::QuicFrame(QuicApplicationCloseFrame* frame) - : type(APPLICATION_CLOSE_FRAME), application_close_frame(frame) {} - QuicFrame::QuicFrame(QuicNewConnectionIdFrame* frame) : type(NEW_CONNECTION_ID_FRAME), new_connection_id_frame(frame) {} @@ -116,9 +113,6 @@ case STOP_SENDING_FRAME: delete frame->stop_sending_frame; break; - case APPLICATION_CLOSE_FRAME: - delete frame->application_close_frame; - break; case NEW_CONNECTION_ID_FRAME: delete frame->new_connection_id_frame; break; @@ -307,9 +301,6 @@ os << "type { MTU_DISCOVERY_FRAME } "; break; } - case APPLICATION_CLOSE_FRAME: - os << "type { APPLICATION_CLOSE } " << *(frame.application_close_frame); - break; case NEW_CONNECTION_ID_FRAME: os << "type { NEW_CONNECTION_ID } " << *(frame.new_connection_id_frame); break;
diff --git a/quic/core/frames/quic_frame.h b/quic/core/frames/quic_frame.h index d753862..c452bf4 100644 --- a/quic/core/frames/quic_frame.h +++ b/quic/core/frames/quic_frame.h
@@ -9,7 +9,6 @@ #include <vector> #include "net/third_party/quiche/src/quic/core/frames/quic_ack_frame.h" -#include "net/third_party/quiche/src/quic/core/frames/quic_application_close_frame.h" #include "net/third_party/quiche/src/quic/core/frames/quic_blocked_frame.h" #include "net/third_party/quiche/src/quic/core/frames/quic_connection_close_frame.h" #include "net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h" @@ -53,7 +52,6 @@ explicit QuicFrame(QuicGoAwayFrame* frame); explicit QuicFrame(QuicWindowUpdateFrame* frame); explicit QuicFrame(QuicBlockedFrame* frame); - explicit QuicFrame(QuicApplicationCloseFrame* frame); explicit QuicFrame(QuicNewConnectionIdFrame* frame); explicit QuicFrame(QuicRetireConnectionIdFrame* frame); explicit QuicFrame(QuicNewTokenFrame* frame); @@ -94,7 +92,6 @@ QuicGoAwayFrame* goaway_frame; QuicWindowUpdateFrame* window_update_frame; QuicBlockedFrame* blocked_frame; - QuicApplicationCloseFrame* application_close_frame; QuicNewConnectionIdFrame* new_connection_id_frame; QuicRetireConnectionIdFrame* retire_connection_id_frame; QuicPathResponseFrame* path_response_frame;
diff --git a/quic/core/frames/quic_frames_test.cc b/quic/core/frames/quic_frames_test.cc index 9c67af4..c432657 100644 --- a/quic/core/frames/quic_frames_test.cc +++ b/quic/core/frames/quic_frames_test.cc
@@ -137,8 +137,12 @@ frame.error_details = "No recent network activity."; std::ostringstream stream; stream << frame; + // Note that "extracted_error_code: 122" is QUIC_IETF_GQUIC_ERROR_MISSING, + // indicating that, in fact, no extended error code was available from the + // underlying frame. EXPECT_EQ( - "{ Close type: UNINITIALIZED, error_code: 25, extracted_error_code: 122, " + "{ Close type: GOOGLE_QUIC_CONNECTION_CLOSE, error_code: 25, " + "extracted_error_code: 122, " "error_details: 'No recent " "network activity.', " "frame_type: 0"
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc index d90413a..311651c 100644 --- a/quic/core/quic_connection.cc +++ b/quic/core/quic_connection.cc
@@ -1253,7 +1253,7 @@ } bool QuicConnection::OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) { + const QuicConnectionCloseFrame& frame) { // TODO(fkastenholz): Need to figure out what the right thing is to do with // this when we get one. Most likely, the correct action is to mimic the // OnConnectionCloseFrame actions, with possibly an indication to the @@ -3020,6 +3020,9 @@ } QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame(error, details); + if (transport_version() == QUIC_VERSION_99) { + frame->close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; + } packet_generator_.AddControlFrame(QuicFrame(frame)); packet_generator_.FlushAllQueuedFrames(); }
diff --git a/quic/core/quic_connection.h b/quic/core/quic_connection.h index 7f8b8c8..602361e 100644 --- a/quic/core/quic_connection.h +++ b/quic/core/quic_connection.h
@@ -253,9 +253,9 @@ // Called when a ConnectionCloseFrame has been parsed. virtual void OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) {} - // Called when an ApplicationCloseFrame has been parsed. - virtual void OnApplicationCloseFrame(const QuicApplicationCloseFrame& frame) { - } + // Called when an IETF QUIC CONNECTION_CLOSE/Application Frame has been + // parsed. + virtual void OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) {} // Called when a WindowUpdate has been parsed. virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame, @@ -498,7 +498,7 @@ bool OnPingFrame(const QuicPingFrame& frame) override; bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override; bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override; - bool OnApplicationCloseFrame(const QuicApplicationCloseFrame& frame) override; + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override; bool OnStopSendingFrame(const QuicStopSendingFrame& frame) override; bool OnPathChallengeFrame(const QuicPathChallengeFrame& frame) override; bool OnPathResponseFrame(const QuicPathResponseFrame& frame) override;
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc index 78f31e1..7345246 100644 --- a/quic/core/quic_connection_test.cc +++ b/quic/core/quic_connection_test.cc
@@ -1309,6 +1309,9 @@ } QuicConnectionCloseFrame qccf(QUIC_PEER_GOING_AWAY); + if (peer_framer_.transport_version() == QUIC_VERSION_99) { + qccf.close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; + } QuicFrames frames; frames.push_back(QuicFrame(&qccf)); @@ -7015,6 +7018,9 @@ header.version_flag = false; QuicConnectionCloseFrame qccf(QUIC_PEER_GOING_AWAY); + if (peer_framer_.transport_version() == QUIC_VERSION_99) { + qccf.close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; + } QuicFrames frames; frames.push_back(QuicFrame(frame1_));
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc index 8024394..c9f5fbf 100644 --- a/quic/core/quic_dispatcher.cc +++ b/quic/core/quic_dispatcher.cc
@@ -138,6 +138,11 @@ bool ietf_quic) { QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame(error_code, error_details); + // TODO(fkastenholz): The framer version may be incorrect in some cases. + if (framer_->transport_version() == QUIC_VERSION_99) { + frame->close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; + } + if (!creator_.AddSavedFrame(QuicFrame(frame), NOT_RETRANSMISSION)) { QUIC_BUG << "Unable to add frame to an empty packet"; delete frame; @@ -916,7 +921,7 @@ } bool QuicDispatcher::OnApplicationCloseFrame( - const QuicApplicationCloseFrame& /*frame*/) { + const QuicConnectionCloseFrame& /*frame*/) { DCHECK(false); return false; }
diff --git a/quic/core/quic_dispatcher.h b/quic/core/quic_dispatcher.h index f00880b..3329405 100644 --- a/quic/core/quic_dispatcher.h +++ b/quic/core/quic_dispatcher.h
@@ -165,7 +165,7 @@ bool OnPingFrame(const QuicPingFrame& frame) override; bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override; bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override; - bool OnApplicationCloseFrame(const QuicApplicationCloseFrame& frame) override; + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override; bool OnStopSendingFrame(const QuicStopSendingFrame& frame) override; bool OnPathChallengeFrame(const QuicPathChallengeFrame& frame) override; bool OnPathResponseFrame(const QuicPathResponseFrame& frame) override;
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc index c24a23c..f99b60f 100644 --- a/quic/core/quic_framer.cc +++ b/quic/core/quic_framer.cc
@@ -588,28 +588,30 @@ QuicTransportVersion version, const QuicConnectionCloseFrame& frame) { if (version == QUIC_VERSION_99) { + // TODO(fkastenholz): For complete support of IETF QUIC CONNECTION_CLOSE, + // check if the frame is a Transport close and if the frame's + // extracted_error_code is not QUIC_IETF_GQUIC_ERROR_MISSING. If so, + // extend the error string to include " QuicErrorCode: #" + if (frame.close_type == IETF_QUIC_APPLICATION_CONNECTION_CLOSE) { + // Application close variant does not include the transport close frame + // type field. + return QuicDataWriter::GetVarInt62Len( + TruncatedErrorStringSize(frame.error_details)) + + kQuicFrameTypeSize + kQuicIetfQuicErrorCodeSize; + } + QUIC_BUG_IF(frame.close_type != IETF_QUIC_TRANSPORT_CONNECTION_CLOSE) + << "IETF QUIC Connection close and QuicConnectionCloseFrame type is " + "not IETF ConnectionClose"; return QuicDataWriter::GetVarInt62Len( TruncatedErrorStringSize(frame.error_details)) + QuicDataWriter::GetVarInt62Len(frame.transport_close_frame_type) + kQuicFrameTypeSize + kQuicIetfQuicErrorCodeSize; } + // Not version 99/IETF QUIC, return Google QUIC CONNECTION CLOSE frame size. return kQuicFrameTypeSize + kQuicErrorCodeSize + kQuicErrorDetailsLengthSize; } // static -size_t QuicFramer::GetMinApplicationCloseFrameSize( - QuicTransportVersion version, - const QuicApplicationCloseFrame& frame) { - if (version != QUIC_VERSION_99) { - QUIC_BUG << "In version " << version - << " - not 99 - and tried to serialize ApplicationClose."; - } - return QuicDataWriter::GetVarInt62Len( - TruncatedErrorStringSize(frame.error_details)) + - kQuicFrameTypeSize + kQuicIetfQuicErrorCodeSize; -} - -// static size_t QuicFramer::GetMinGoAwayFrameSize() { return kQuicFrameTypeSize + kQuicErrorCodeSize + kQuicErrorDetailsLengthSize + kQuicMaxStreamIdSize; @@ -721,11 +723,6 @@ return GetWindowUpdateFrameSize(version, *frame.window_update_frame); case BLOCKED_FRAME: return GetBlockedFrameSize(version, *frame.blocked_frame); - case APPLICATION_CLOSE_FRAME: - return GetMinApplicationCloseFrameSize(version, - *frame.application_close_frame) + - TruncatedErrorStringSize( - frame.application_close_frame->error_details); case NEW_CONNECTION_ID_FRAME: return GetNewConnectionIdFrameSize(*frame.new_connection_id_frame); case RETIRE_CONNECTION_ID_FRAME: @@ -1027,10 +1024,6 @@ return 0; } break; - case APPLICATION_CLOSE_FRAME: - set_detailed_error( - "Attempt to append APPLICATION_CLOSE frame and not in version 99."); - return RaiseError(QUIC_INTERNAL_ERROR); case NEW_CONNECTION_ID_FRAME: set_detailed_error( "Attempt to append NEW_CONNECTION_ID frame and not in version 99."); @@ -1144,9 +1137,10 @@ } break; case CONNECTION_CLOSE_FRAME: - if (!AppendConnectionCloseFrame(*frame.connection_close_frame, - writer)) { - QUIC_BUG << "AppendConnectionCloseFrame failed: " << detailed_error(); + if (!AppendIetfConnectionCloseFrame(*frame.connection_close_frame, + writer)) { + QUIC_BUG << "AppendIetfConnectionCloseFrame failed: " + << detailed_error(); return 0; } break; @@ -1175,14 +1169,6 @@ return 0; } break; - case APPLICATION_CLOSE_FRAME: - if (!AppendApplicationCloseFrame(*frame.application_close_frame, - writer)) { - QUIC_BUG << "AppendApplicationCloseFrame failed: " - << detailed_error(); - return 0; - } - break; case MAX_STREAM_ID_FRAME: if (!AppendMaxStreamsFrame(frame.max_stream_id_frame, writer)) { QUIC_BUG << "AppendMaxStreamsFrame failed" << detailed_error(); @@ -2906,11 +2892,7 @@ case IETF_CONNECTION_CLOSE: { QuicConnectionCloseFrame frame; if (!ProcessIetfConnectionCloseFrame( - reader, - ((frame_type == IETF_CONNECTION_CLOSE) - ? IETF_QUIC_TRANSPORT_CONNECTION_CLOSE - : IETF_QUIC_APPLICATION_CONNECTION_CLOSE), - &frame)) { + reader, IETF_QUIC_TRANSPORT_CONNECTION_CLOSE, &frame)) { return RaiseError(QUIC_INVALID_CONNECTION_CLOSE_DATA); } if (!visitor_->OnConnectionCloseFrame(frame)) { @@ -2921,8 +2903,9 @@ break; } case IETF_APPLICATION_CLOSE: { - QuicApplicationCloseFrame frame; - if (!ProcessApplicationCloseFrame(reader, &frame)) { + QuicConnectionCloseFrame frame; + if (!ProcessIetfConnectionCloseFrame( + reader, IETF_QUIC_APPLICATION_CONNECTION_CLOSE, &frame)) { return RaiseError(QUIC_INVALID_APPLICATION_CLOSE_DATA); } if (!visitor_->OnApplicationCloseFrame(frame)) { @@ -4238,11 +4221,6 @@ case MTU_DISCOVERY_FRAME: type_byte = static_cast<uint8_t>(PING_FRAME); break; - - case APPLICATION_CLOSE_FRAME: - set_detailed_error( - "Attempt to append APPLICATION_CLOSE frame and not in version 99."); - return RaiseError(QUIC_INTERNAL_ERROR); case NEW_CONNECTION_ID_FRAME: set_detailed_error( "Attempt to append NEW_CONNECTION_ID frame and not in version 99."); @@ -4299,7 +4277,17 @@ type_byte = IETF_RST_STREAM; break; case CONNECTION_CLOSE_FRAME: - type_byte = IETF_CONNECTION_CLOSE; + switch (frame.connection_close_frame->close_type) { + case IETF_QUIC_APPLICATION_CONNECTION_CLOSE: + type_byte = IETF_APPLICATION_CLOSE; + break; + case IETF_QUIC_TRANSPORT_CONNECTION_CLOSE: + type_byte = IETF_CONNECTION_CLOSE; + break; + default: + set_detailed_error("Invalid QuicConnectionCloseFrame type."); + return RaiseError(QUIC_INTERNAL_ERROR); + } break; case GOAWAY_FRAME: set_detailed_error( @@ -4342,9 +4330,6 @@ // The path MTU discovery frame is encoded as a PING frame on the wire. type_byte = IETF_PING; break; - case APPLICATION_CLOSE_FRAME: - type_byte = IETF_APPLICATION_CLOSE; - break; case NEW_CONNECTION_ID_FRAME: type_byte = IETF_NEW_CONNECTION_ID; break; @@ -5187,16 +5172,31 @@ bool QuicFramer::AppendIetfConnectionCloseFrame( const QuicConnectionCloseFrame& frame, QuicDataWriter* writer) { + if (frame.close_type != IETF_QUIC_TRANSPORT_CONNECTION_CLOSE && + frame.close_type != IETF_QUIC_APPLICATION_CONNECTION_CLOSE) { + QUIC_BUG << "Invalid close_type for writing IETF CONNECTION CLOSE."; + set_detailed_error("Invalid close_type for writing IETF CONNECTION CLOSE."); + return false; + } + if (!writer->WriteUInt16(frame.application_error_code)) { set_detailed_error("Can not write connection close frame error code"); return false; } - if (!writer->WriteVarInt62(frame.transport_close_frame_type)) { - set_detailed_error("Writing frame type failed."); - return false; + if (frame.close_type == IETF_QUIC_TRANSPORT_CONNECTION_CLOSE) { + // Write the frame-type of the frame causing the error only + // if it's a CONNECTION_CLOSE/Transport. + if (!writer->WriteVarInt62(frame.transport_close_frame_type)) { + set_detailed_error("Writing frame type failed."); + return false; + } } + // TODO(fkastenholz): For full IETF CONNECTION CLOSE support, + // if this is a Transport CONNECTION_CLOSE and the extended + // error is not QUIC_IETF_GQUIC_ERROR_MISSING then append the extended + // "QuicErrorCode: #" string to the phrase. if (!writer->WriteStringPieceVarInt62( TruncateErrorString(frame.error_details))) { set_detailed_error("Can not write connection close phrase"); @@ -5205,22 +5205,6 @@ return true; } -bool QuicFramer::AppendApplicationCloseFrame( - const QuicApplicationCloseFrame& frame, - QuicDataWriter* writer) { - if (!writer->WriteUInt16(static_cast<const uint16_t>(frame.error_code))) { - set_detailed_error("Can not write application close frame error code"); - return false; - } - - if (!writer->WriteStringPieceVarInt62( - TruncateErrorString(frame.error_details))) { - set_detailed_error("Can not write application close phrase"); - return false; - } - return true; -} - bool QuicFramer::ProcessIetfConnectionCloseFrame( QuicDataReader* reader, QuicConnectionCloseType type, @@ -5233,9 +5217,13 @@ } frame->transport_error_code = static_cast<QuicIetfTransportErrorCodes>(code); - if (!reader->ReadVarInt62(&frame->transport_close_frame_type)) { - set_detailed_error("Unable to read connection close frame type."); - return false; + if (type == IETF_QUIC_TRANSPORT_CONNECTION_CLOSE) { + // The frame-type of the frame causing the error is present only + // if it's a CONNECTION_CLOSE/Transport. + if (!reader->ReadVarInt62(&frame->transport_close_frame_type)) { + set_detailed_error("Unable to read connection close frame type."); + return false; + } } uint64_t phrase_length; @@ -5248,31 +5236,9 @@ set_detailed_error("Unable to read connection close error details."); return false; } - frame->error_details = std::string(phrase); - - return true; -} - -bool QuicFramer::ProcessApplicationCloseFrame( - QuicDataReader* reader, - QuicApplicationCloseFrame* frame) { - uint16_t code; - if (!reader->ReadUInt16(&code)) { - set_detailed_error("Unable to read application close error code."); - return false; - } - frame->error_code = static_cast<QuicErrorCode>(code); - - uint64_t phrase_length; - if (!reader->ReadVarInt62(&phrase_length)) { - set_detailed_error("Unable to read application close error details."); - return false; - } - QuicStringPiece phrase; - if (!reader->ReadStringPiece(&phrase, static_cast<size_t>(phrase_length))) { - set_detailed_error("Unable to read application close error details."); - return false; - } + // TODO(fkastenholz): when full support is done, add code here + // to extract the extended error code from the reason phrase + // and set it into frame->extracted_error_code. frame->error_details = std::string(phrase); return true;
diff --git a/quic/core/quic_framer.h b/quic/core/quic_framer.h index 84773b4..fc189b2 100644 --- a/quic/core/quic_framer.h +++ b/quic/core/quic_framer.h
@@ -158,9 +158,12 @@ virtual bool OnConnectionCloseFrame( const QuicConnectionCloseFrame& frame) = 0; - // Called when an IETF ApplicationCloseFrame has been parsed. + // Called when an IETF QUIC CONNECTION_CLOSE/Application Frame has been + // parsed. TEMPORARILY pass the frame as a QuicConnectionCloseFrame. + // TODO(fkastenholz): remove when V99 fully utilizes the IETF + // CONNECTION_CLOSE close frame. virtual bool OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) = 0; + const QuicConnectionCloseFrame& frame) = 0; // Called when a StopSendingFrame has been parsed. virtual bool OnStopSendingFrame(const QuicStopSendingFrame& frame) = 0; @@ -304,9 +307,6 @@ static size_t GetMinConnectionCloseFrameSize( QuicTransportVersion version, const QuicConnectionCloseFrame& frame); - static size_t GetMinApplicationCloseFrameSize( - QuicTransportVersion version, - const QuicApplicationCloseFrame& frame); // Size in bytes of all GoAway frame fields without the reason phrase. static size_t GetMinGoAwayFrameSize(); // Size in bytes of all WindowUpdate frame fields. @@ -776,8 +776,6 @@ bool ProcessIetfConnectionCloseFrame(QuicDataReader* reader, QuicConnectionCloseType type, QuicConnectionCloseFrame* frame); - bool ProcessApplicationCloseFrame(QuicDataReader* reader, - QuicApplicationCloseFrame* frame); bool ProcessPathChallengeFrame(QuicDataReader* reader, QuicPathChallengeFrame* frame); bool ProcessPathResponseFrame(QuicDataReader* reader, @@ -794,8 +792,6 @@ QuicDataWriter* writer); bool AppendIetfConnectionCloseFrame(const QuicConnectionCloseFrame& frame, QuicDataWriter* writer); - bool AppendApplicationCloseFrame(const QuicApplicationCloseFrame& frame, - QuicDataWriter* writer); bool AppendPathChallengeFrame(const QuicPathChallengeFrame& frame, QuicDataWriter* writer); bool AppendPathResponseFrame(const QuicPathResponseFrame& frame,
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc index 927b100..997f1f1 100644 --- a/quic/core/quic_framer_test.cc +++ b/quic/core/quic_framer_test.cc
@@ -315,9 +315,12 @@ return true; } - bool OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) override { - application_close_frame_ = frame; + // TODO(fkastenholz): Remove when IETF QUIC is completely converted to + // doing Connection Close. + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override { + // OnApplicationCloseFrame receives a QuicConnectionCloseFrame as part of + // migration to IETF QUIC's new model. + connection_close_frame_ = frame; return true; } @@ -410,7 +413,6 @@ std::vector<std::unique_ptr<QuicEncryptedPacket>> coalesced_packets_; QuicRstStreamFrame rst_stream_frame_; QuicConnectionCloseFrame connection_close_frame_; - QuicApplicationCloseFrame application_close_frame_; QuicStopSendingFrame stop_sending_frame_; QuicGoAwayFrame goaway_frame_; QuicPathChallengeFrame path_challenge_frame_; @@ -4421,13 +4423,13 @@ // packet number {"", {0x12, 0x34, 0x56, 0x78}}, - // frame type (IETF_APPLICATION_CLOSE frame) + // frame type (IETF_CONNECTION_CLOSE/Application frame) {"", {0x1d}}, // error code - {"Unable to read application close error code.", + {"Unable to read connection close error code.", {0x00, 0x11}}, - {"Unable to read application close error details.", + {"Unable to read connection close error details.", { // error details length kVarInt62OneByte + 0x0d, @@ -4452,8 +4454,11 @@ EXPECT_EQ(0u, visitor_.stream_frames_.size()); - EXPECT_EQ(0x11, visitor_.application_close_frame_.error_code); - EXPECT_EQ("because I can", visitor_.application_close_frame_.error_details); + EXPECT_EQ(IETF_QUIC_APPLICATION_CONNECTION_CLOSE, + visitor_.connection_close_frame_.close_type); + EXPECT_EQ(122u, visitor_.connection_close_frame_.extracted_error_code); + EXPECT_EQ(0x11, visitor_.connection_close_frame_.quic_error_code); + EXPECT_EQ("because I can", visitor_.connection_close_frame_.error_details); ASSERT_EQ(0u, visitor_.ack_frames_.size()); @@ -7283,6 +7288,7 @@ close_frame.transport_error_code = static_cast<QuicIetfTransportErrorCodes>(0x11); close_frame.transport_close_frame_type = 0x05; + close_frame.close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; } else { close_frame.quic_error_code = static_cast<QuicErrorCode>(0x05060708); } @@ -7409,6 +7415,7 @@ if (framer_.transport_version() == QUIC_VERSION_99) { close_frame.transport_error_code = PROTOCOL_VIOLATION; // value is 0x0a EXPECT_EQ(0u, close_frame.transport_close_frame_type); + close_frame.close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; } else { close_frame.quic_error_code = static_cast<QuicErrorCode>(0x05060708); } @@ -7646,9 +7653,10 @@ header.version_flag = false; header.packet_number = kPacketNumber; - QuicApplicationCloseFrame app_close_frame; - app_close_frame.error_code = static_cast<QuicErrorCode>(0x11); + QuicConnectionCloseFrame app_close_frame; + app_close_frame.quic_error_code = static_cast<QuicErrorCode>(0x11); app_close_frame.error_details = "because I can"; + app_close_frame.close_type = IETF_QUIC_APPLICATION_CONNECTION_CLOSE; QuicFrames frames = {QuicFrame(&app_close_frame)}; @@ -7695,9 +7703,10 @@ header.version_flag = false; header.packet_number = kPacketNumber; - QuicApplicationCloseFrame app_close_frame; - app_close_frame.error_code = static_cast<QuicErrorCode>(0x11); + QuicConnectionCloseFrame app_close_frame; + app_close_frame.quic_error_code = static_cast<QuicErrorCode>(0x11); app_close_frame.error_details = std::string(2048, 'A'); + app_close_frame.close_type = IETF_QUIC_APPLICATION_CONNECTION_CLOSE; QuicFrames frames = {QuicFrame(&app_close_frame)}; @@ -11623,6 +11632,10 @@ std::string error_detail(2048, 'e'); QuicConnectionCloseFrame connection_close(QUIC_NETWORK_IDLE_TIMEOUT, error_detail); + if (framer_.transport_version() == QUIC_VERSION_99) { + connection_close.close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; + } + EXPECT_EQ(QuicFramer::GetMinConnectionCloseFrameSize( framer_.transport_version(), connection_close) + 256, @@ -11649,11 +11662,6 @@ if (framer_.transport_version() != QUIC_VERSION_99) { return; } - QuicApplicationCloseFrame application_close; - EXPECT_EQ(QuicFramer::GetMinApplicationCloseFrameSize( - framer_.transport_version(), application_close), - QuicFramer::GetRetransmittableControlFrameSize( - framer_.transport_version(), QuicFrame(&application_close))); QuicNewConnectionIdFrame new_connection_id(5, TestConnectionId(), 1, 101111); EXPECT_EQ(QuicFramer::GetNewConnectionIdFrameSize(new_connection_id),
diff --git a/quic/core/quic_ietf_framer_test.cc b/quic/core/quic_ietf_framer_test.cc index 9c30e9c..987bce9 100644 --- a/quic/core/quic_ietf_framer_test.cc +++ b/quic/core/quic_ietf_framer_test.cc
@@ -155,8 +155,9 @@ return true; } - bool OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) override { + // TODO(fkastenholz): remove when finishing conversion to new IETF QUIC + // model. + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override { return true; } @@ -801,6 +802,7 @@ sent_frame.quic_error_code = static_cast<QuicErrorCode>(0); sent_frame.error_details = test_string; sent_frame.transport_close_frame_type = 123; + sent_frame.close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; // write the frame to the packet buffer. EXPECT_TRUE(QuicFramerPeer::AppendIetfConnectionCloseFrame( &framer_, sent_frame, &writer)); @@ -818,8 +820,11 @@ &framer_, &reader, IETF_QUIC_TRANSPORT_CONNECTION_CLOSE, &sink_frame)); // Now check that received == sent + EXPECT_EQ(sent_frame.quic_error_code, sink_frame.quic_error_code); EXPECT_EQ(sink_frame.quic_error_code, static_cast<QuicErrorCode>(0)); EXPECT_EQ(sink_frame.error_details, test_string); + EXPECT_EQ(sink_frame.close_type, sent_frame.close_type); + EXPECT_EQ(sent_frame.close_type, IETF_QUIC_TRANSPORT_CONNECTION_CLOSE); } TEST_F(QuicIetfFramerTest, ApplicationCloseEmptyString) { @@ -832,12 +837,13 @@ // empty string, std::string test_string = "Ich Bin Ein Jelly Donut?"; - QuicApplicationCloseFrame sent_frame; - sent_frame.error_code = static_cast<QuicErrorCode>(0); + QuicConnectionCloseFrame sent_frame; + sent_frame.quic_error_code = static_cast<QuicErrorCode>(0); sent_frame.error_details = test_string; + sent_frame.close_type = IETF_QUIC_APPLICATION_CONNECTION_CLOSE; // write the frame to the packet buffer. - EXPECT_TRUE(QuicFramerPeer::AppendApplicationCloseFrame(&framer_, sent_frame, - &writer)); + EXPECT_TRUE(QuicFramerPeer::AppendIetfConnectionCloseFrame( + &framer_, sent_frame, &writer)); // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); @@ -846,14 +852,17 @@ QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // a QuicConnectionCloseFrame to hold the results. - QuicApplicationCloseFrame sink_frame; + QuicConnectionCloseFrame sink_frame; - EXPECT_TRUE(QuicFramerPeer::ProcessApplicationCloseFrame(&framer_, &reader, - &sink_frame)); + EXPECT_TRUE(QuicFramerPeer::ProcessIetfConnectionCloseFrame( + &framer_, &reader, IETF_QUIC_APPLICATION_CONNECTION_CLOSE, &sink_frame)); // Now check that received == sent - EXPECT_EQ(sink_frame.error_code, static_cast<QuicErrorCode>(0)); + EXPECT_EQ(sink_frame.quic_error_code, static_cast<QuicErrorCode>(0)); + EXPECT_EQ(sent_frame.quic_error_code, sink_frame.quic_error_code); EXPECT_EQ(sink_frame.error_details, test_string); + EXPECT_EQ(sent_frame.close_type, IETF_QUIC_APPLICATION_CONNECTION_CLOSE); + EXPECT_EQ(sent_frame.close_type, sink_frame.close_type); } // Testing for the IETF ACK framer.
diff --git a/quic/core/quic_packet_creator_test.cc b/quic/core/quic_packet_creator_test.cc index d463846..b642c9f 100644 --- a/quic/core/quic_packet_creator_test.cc +++ b/quic/core/quic_packet_creator_test.cc
@@ -562,6 +562,9 @@ TEST_P(QuicPacketCreatorTest, SerializeConnectionClose) { QuicConnectionCloseFrame frame(QUIC_NO_ERROR, "error"); + if (GetParam().version.transport_version == QUIC_VERSION_99) { + frame.close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; + } QuicFrames frames; frames.push_back(QuicFrame(&frame));
diff --git a/quic/core/quic_packet_generator_test.cc b/quic/core/quic_packet_generator_test.cc index 9edddfc..223383a 100644 --- a/quic/core/quic_packet_generator_test.cc +++ b/quic/core/quic_packet_generator_test.cc
@@ -1349,6 +1349,9 @@ QuicStringPiece error_details(buf, 2000); QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame( QUIC_PACKET_WRITE_ERROR, std::string(error_details)); + if (framer_.transport_version() == QUIC_VERSION_99) { + frame->close_type = IETF_QUIC_TRANSPORT_CONNECTION_CLOSE; + } generator_.AddControlFrame(QuicFrame(frame), /*bundle_ack=*/false); EXPECT_TRUE(generator_.HasQueuedFrames()); EXPECT_TRUE(generator_.HasRetransmittableFrames());
diff --git a/quic/core/quic_trace_visitor.cc b/quic/core/quic_trace_visitor.cc index 2c13b56..5fdab2d 100644 --- a/quic/core/quic_trace_visitor.cc +++ b/quic/core/quic_trace_visitor.cc
@@ -76,7 +76,6 @@ break; // New IETF frames, not used in current gQUIC version. - case APPLICATION_CLOSE_FRAME: case NEW_CONNECTION_ID_FRAME: case RETIRE_CONNECTION_ID_FRAME: case MAX_STREAM_ID_FRAME: @@ -154,6 +153,10 @@ quic_trace::CloseInfo* info = frame_record->mutable_close_info(); info->set_error_code(frame.connection_close_frame->quic_error_code); info->set_reason_phrase(frame.connection_close_frame->error_details); + info->set_close_type(static_cast<quic_trace::CloseType>( + frame.connection_close_frame->close_type)); + info->set_transport_close_frame_type( + frame.connection_close_frame->transport_close_frame_type); break; } @@ -203,7 +206,6 @@ break; // New IETF frames, not used in current gQUIC version. - case APPLICATION_CLOSE_FRAME: case NEW_CONNECTION_ID_FRAME: case RETIRE_CONNECTION_ID_FRAME: case MAX_STREAM_ID_FRAME:
diff --git a/quic/core/quic_types.h b/quic/core/quic_types.h index aeedbb5..c23d297 100644 --- a/quic/core/quic_types.h +++ b/quic/core/quic_types.h
@@ -191,7 +191,6 @@ // from Google QUIC frames. These are valid/allowed if and only if IETF- // QUIC has been negotiated. Values are not important, they are not // the values that are in the packets (see QuicIetfFrameType, below). - APPLICATION_CLOSE_FRAME, NEW_CONNECTION_ID_FRAME, MAX_STREAM_ID_FRAME, STREAM_ID_BLOCKED_FRAME, @@ -249,7 +248,8 @@ IETF_PATH_RESPONSE = 0x1b, // Both of the following are "Connection Close" frames, // the first signals transport-layer errors, the second application-layer - // errors. + // errors.The frame formats and protocol procedures are the same, the only + // difference is the number space in the frame's error code field. IETF_CONNECTION_CLOSE = 0x1c, IETF_APPLICATION_CLOSE = 0x1d,
diff --git a/quic/test_tools/quic_framer_peer.cc b/quic/test_tools/quic_framer_peer.cc index 9b7da0b..13b3150 100644 --- a/quic/test_tools/quic_framer_peer.cc +++ b/quic/test_tools/quic_framer_peer.cc
@@ -101,14 +101,6 @@ } // static -bool QuicFramerPeer::AppendApplicationCloseFrame( - QuicFramer* framer, - const QuicApplicationCloseFrame& frame, - QuicDataWriter* writer) { - return framer->AppendApplicationCloseFrame(frame, writer); -} - -// static bool QuicFramerPeer::ProcessIetfConnectionCloseFrame( QuicFramer* framer, QuicDataReader* reader, @@ -118,14 +110,6 @@ } // static -bool QuicFramerPeer::ProcessApplicationCloseFrame( - QuicFramer* framer, - QuicDataReader* reader, - QuicApplicationCloseFrame* frame) { - return framer->ProcessApplicationCloseFrame(reader, frame); -} - -// static bool QuicFramerPeer::ProcessPathChallengeFrame(QuicFramer* framer, QuicDataReader* reader, QuicPathChallengeFrame* frame) {
diff --git a/quic/test_tools/quic_framer_peer.h b/quic/test_tools/quic_framer_peer.h index 2db5af0..7b23189 100644 --- a/quic/test_tools/quic_framer_peer.h +++ b/quic/test_tools/quic_framer_peer.h
@@ -55,17 +55,10 @@ QuicFramer* framer, const QuicConnectionCloseFrame& frame, QuicDataWriter* writer); - static bool AppendApplicationCloseFrame( - QuicFramer* framer, - const QuicApplicationCloseFrame& frame, - QuicDataWriter* writer); static bool ProcessIetfConnectionCloseFrame(QuicFramer* framer, QuicDataReader* reader, QuicConnectionCloseType type, QuicConnectionCloseFrame* frame); - static bool ProcessApplicationCloseFrame(QuicFramer* framer, - QuicDataReader* reader, - QuicApplicationCloseFrame* frame); static bool ProcessIetfAckFrame(QuicFramer* framer, QuicDataReader* reader, uint64_t frame_type,
diff --git a/quic/test_tools/quic_test_utils.cc b/quic/test_tools/quic_test_utils.cc index e5988e0..cd54eb8 100644 --- a/quic/test_tools/quic_test_utils.cc +++ b/quic/test_tools/quic_test_utils.cc
@@ -282,7 +282,7 @@ } bool NoOpFramerVisitor::OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) { + const QuicConnectionCloseFrame& frame) { return true; }
diff --git a/quic/test_tools/quic_test_utils.h b/quic/test_tools/quic_test_utils.h index 00c9748..561362a 100644 --- a/quic/test_tools/quic_test_utils.h +++ b/quic/test_tools/quic_test_utils.h
@@ -270,7 +270,7 @@ MOCK_METHOD1(OnConnectionCloseFrame, bool(const QuicConnectionCloseFrame& frame)); MOCK_METHOD1(OnApplicationCloseFrame, - bool(const QuicApplicationCloseFrame& frame)); + bool(const QuicConnectionCloseFrame& frame)); MOCK_METHOD1(OnNewConnectionIdFrame, bool(const QuicNewConnectionIdFrame& frame)); MOCK_METHOD1(OnRetireConnectionIdFrame, @@ -323,7 +323,7 @@ bool OnPingFrame(const QuicPingFrame& frame) override; bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override; bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override; - bool OnApplicationCloseFrame(const QuicApplicationCloseFrame& frame) override; + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override; bool OnNewConnectionIdFrame(const QuicNewConnectionIdFrame& frame) override; bool OnRetireConnectionIdFrame( const QuicRetireConnectionIdFrame& frame) override; @@ -1004,7 +1004,7 @@ MOCK_METHOD1(OnConnectionCloseFrame, void(const QuicConnectionCloseFrame&)); - MOCK_METHOD1(OnApplicationCloseFrame, void(const QuicApplicationCloseFrame&)); + MOCK_METHOD1(OnApplicationCloseFrame, void(const QuicConnectionCloseFrame&)); MOCK_METHOD1(OnStopSendingFrame, void(const QuicStopSendingFrame&));
diff --git a/quic/test_tools/simple_quic_framer.cc b/quic/test_tools/simple_quic_framer.cc index c02ed15..7b6e753 100644 --- a/quic/test_tools/simple_quic_framer.cc +++ b/quic/test_tools/simple_quic_framer.cc
@@ -125,8 +125,7 @@ return true; } - bool OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) override { + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override { application_close_frames_.push_back(frame); return true; } @@ -208,7 +207,7 @@ const std::vector<QuicConnectionCloseFrame>& connection_close_frames() const { return connection_close_frames_; } - const std::vector<QuicApplicationCloseFrame>& application_close_frames() + const std::vector<QuicConnectionCloseFrame>& application_close_frames() const { return application_close_frames_; } @@ -273,7 +272,7 @@ std::vector<QuicStreamIdBlockedFrame> stream_id_blocked_frames_; std::vector<QuicMaxStreamIdFrame> max_stream_id_frames_; std::vector<QuicConnectionCloseFrame> connection_close_frames_; - std::vector<QuicApplicationCloseFrame> application_close_frames_; + std::vector<QuicConnectionCloseFrame> application_close_frames_; std::vector<QuicStopSendingFrame> stop_sending_frames_; std::vector<QuicPathChallengeFrame> path_challenge_frames_; std::vector<QuicPathResponseFrame> path_response_frames_;
diff --git a/quic/tools/quic_packet_printer_bin.cc b/quic/tools/quic_packet_printer_bin.cc index 28bc790..25c7b67 100644 --- a/quic/tools/quic_packet_printer_bin.cc +++ b/quic/tools/quic_packet_printer_bin.cc
@@ -136,8 +136,10 @@ std::cerr << "OnConnectionCloseFrame: " << frame; return true; } - bool OnApplicationCloseFrame( - const QuicApplicationCloseFrame& frame) override { + bool OnApplicationCloseFrame(const QuicConnectionCloseFrame& frame) override { + // The frame printout will indicate whether it's a Google QUIC + // CONNECTION_CLOSE, IETF QUIC CONNECTION_CLOSE/Transport, or IETF QUIC + // CONNECTION_CLOSE/Application frame. std::cerr << "OnApplicationCloseFrame: " << frame; return true; }