Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: net/quic/quic_framer.cc

Issue 1433703005: Pass in connection ID and supported version to QuicFramer::BuildVersionNegotiationPacket, instead … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106947577
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_framer.h ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.cc
diff --git a/net/quic/quic_framer.cc b/net/quic/quic_framer.cc
index 1d062fd720dd9134dd8db906a9a06f8924038d3a..45b9c67572cb3e6f87e265a8eee3e8ecfc97c57b 100644
--- a/net/quic/quic_framer.cc
+++ b/net/quic/quic_framer.cc
@@ -477,11 +477,12 @@ QuicEncryptedPacket* QuicFramer::BuildPublicResetPacket(
return new QuicEncryptedPacket(buffer.release(), len, true);
}
+// static
QuicEncryptedPacket* QuicFramer::BuildVersionNegotiationPacket(
- const QuicPacketPublicHeader& header,
- const QuicVersionVector& supported_versions) {
- DCHECK(header.version_flag);
- size_t len = GetVersionNegotiationPacketSize(supported_versions.size());
+ QuicConnectionId connection_id,
+ const QuicVersionVector& versions) {
+ DCHECK(!versions.empty());
+ size_t len = GetVersionNegotiationPacketSize(versions.size());
scoped_ptr<char[]> buffer(new char[len]);
QuicDataWriter writer(len, buffer.get());
@@ -491,12 +492,12 @@ QuicEncryptedPacket* QuicFramer::BuildVersionNegotiationPacket(
return nullptr;
}
- if (!writer.WriteUInt64(header.connection_id)) {
+ if (!writer.WriteUInt64(connection_id)) {
return nullptr;
}
- for (size_t i = 0; i < supported_versions.size(); ++i) {
- if (!writer.WriteUInt32(QuicVersionToQuicTag(supported_versions[i]))) {
+ for (QuicVersion version : versions) {
+ if (!writer.WriteUInt32(QuicVersionToQuicTag(version))) {
return nullptr;
}
}
« no previous file with comments | « net/quic/quic_framer.h ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698