chromium/chromium-76.0.3809.100-quiche-compile-fix.patch

226 lines
10 KiB
Diff
Raw Normal View History

diff -up chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc.quiche-compile-fix chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc
--- chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc.quiche-compile-fix 2019-08-14 09:58:07.721193200 +0200
+++ chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc 2019-08-14 09:59:33.131041525 +0200
@@ -62,37 +62,37 @@ const size_t kStatelessResetTokenLength
std::string TransportParameterIdToString(
TransportParameters::TransportParameterId param_id) {
switch (param_id) {
- case kOriginalConnectionId:
+ case TransportParameters::kOriginalConnectionId:
return "original_connection_id";
- case kIdleTimeout:
+ case TransportParameters::kIdleTimeout:
return "idle_timeout";
- case kStatelessResetToken:
+ case TransportParameters::kStatelessResetToken:
return "stateless_reset_token";
- case kMaxPacketSize:
+ case TransportParameters::kMaxPacketSize:
return "max_packet_size";
- case kInitialMaxData:
+ case TransportParameters::kInitialMaxData:
return "initial_max_data";
- case kInitialMaxStreamDataBidiLocal:
+ case TransportParameters::kInitialMaxStreamDataBidiLocal:
return "initial_max_stream_data_bidi_local";
- case kInitialMaxStreamDataBidiRemote:
+ case TransportParameters::kInitialMaxStreamDataBidiRemote:
return "initial_max_stream_data_bidi_remote";
- case kInitialMaxStreamDataUni:
+ case TransportParameters::kInitialMaxStreamDataUni:
return "initial_max_stream_data_uni";
- case kInitialMaxStreamsBidi:
+ case TransportParameters::kInitialMaxStreamsBidi:
return "initial_max_streams_bidi";
- case kInitialMaxStreamsUni:
+ case TransportParameters::kInitialMaxStreamsUni:
return "initial_max_streams_uni";
- case kAckDelayExponent:
+ case TransportParameters::kAckDelayExponent:
return "ack_delay_exponent";
- case kMaxAckDelay:
+ case TransportParameters::kMaxAckDelay:
return "max_ack_delay";
- case kDisableMigration:
+ case TransportParameters::kDisableMigration:
return "disable_migration";
- case kPreferredAddress:
+ case TransportParameters::kPreferredAddress:
return "preferred_address";
- case kGoogleQuicParam:
+ case TransportParameters::kGoogleQuicParam:
return "google";
- case kGoogleQuicVersion:
+ case TransportParameters::kGoogleQuicVersion:
return "google-version";
}
return "Unknown(" + QuicTextUtils::Uint64ToString(param_id) + ")";
@@ -390,7 +390,7 @@ bool SerializeTransportParameters(const
CBB original_connection_id_param;
if (!in.original_connection_id.IsEmpty()) {
DCHECK_EQ(Perspective::IS_SERVER, in.perspective);
- if (!CBB_add_u16(&params, kOriginalConnectionId) ||
+ if (!CBB_add_u16(&params, TransportParameters::kOriginalConnectionId) ||
!CBB_add_u16_length_prefixed(&params, &original_connection_id_param) ||
!CBB_add_bytes(
&original_connection_id_param,
@@ -412,7 +412,7 @@ bool SerializeTransportParameters(const
if (!in.stateless_reset_token.empty()) {
DCHECK_EQ(kStatelessResetTokenLength, in.stateless_reset_token.size());
DCHECK_EQ(Perspective::IS_SERVER, in.perspective);
- if (!CBB_add_u16(&params, kStatelessResetToken) ||
+ if (!CBB_add_u16(&params, TransportParameters::kStatelessResetToken) ||
!CBB_add_u16_length_prefixed(&params, &stateless_reset_token_param) ||
!CBB_add_bytes(&stateless_reset_token_param,
in.stateless_reset_token.data(),
@@ -438,7 +438,7 @@ bool SerializeTransportParameters(const
// disable_migration
if (in.disable_migration) {
- if (!CBB_add_u16(&params, kDisableMigration) ||
+ if (!CBB_add_u16(&params, TransportParameters::kDisableMigration) ||
!CBB_add_u16(&params, 0u)) { // 0 is the length of this parameter.
QUIC_BUG << "Failed to write disable_migration for " << in;
return false;
@@ -458,7 +458,7 @@ bool SerializeTransportParameters(const
QUIC_BUG << "Bad lengths " << *in.preferred_address;
return false;
}
- if (!CBB_add_u16(&params, kPreferredAddress) ||
+ if (!CBB_add_u16(&params, TransportParameters::kPreferredAddress) ||
!CBB_add_u16_length_prefixed(&params, &preferred_address_params) ||
!CBB_add_bytes(
&preferred_address_params,
@@ -491,7 +491,7 @@ bool SerializeTransportParameters(const
if (in.google_quic_params) {
const QuicData& serialized_google_quic_params =
in.google_quic_params->GetSerialized();
- if (!CBB_add_u16(&params, kGoogleQuicParam) ||
+ if (!CBB_add_u16(&params, TransportParameters::kGoogleQuicParam) ||
!CBB_add_u16_length_prefixed(&params, &google_quic_params) ||
!CBB_add_bytes(&google_quic_params,
reinterpret_cast<const uint8_t*>(
@@ -505,7 +505,7 @@ bool SerializeTransportParameters(const
// Google-specific version extension.
CBB google_version_params;
- if (!CBB_add_u16(&params, kGoogleQuicVersion) ||
+ if (!CBB_add_u16(&params, TransportParameters::kGoogleQuicVersion) ||
!CBB_add_u16_length_prefixed(&params, &google_version_params) ||
!CBB_add_u32(&google_version_params, in.version)) {
QUIC_BUG << "Failed to write Google version extension for " << in;
@@ -565,7 +565,7 @@ bool ParseTransportParameters(const uint
}
bool parse_success = true;
switch (param_id) {
- case kOriginalConnectionId:
+ case TransportParameters::kOriginalConnectionId:
if (!out->original_connection_id.IsEmpty()) {
QUIC_DLOG(ERROR) << "Received a second original connection ID";
return false;
@@ -581,10 +581,10 @@ bool ParseTransportParameters(const uint
CBS_len(&value));
}
break;
- case kIdleTimeout:
+ case TransportParameters::kIdleTimeout:
parse_success = out->idle_timeout_milliseconds.ReadFromCbs(&value);
break;
- case kStatelessResetToken:
+ case TransportParameters::kStatelessResetToken:
if (!out->stateless_reset_token.empty()) {
QUIC_DLOG(ERROR) << "Received a second stateless reset token";
return false;
@@ -597,36 +597,36 @@ bool ParseTransportParameters(const uint
out->stateless_reset_token.assign(CBS_data(&value),
CBS_data(&value) + CBS_len(&value));
break;
- case kMaxPacketSize:
+ case TransportParameters::kMaxPacketSize:
parse_success = out->max_packet_size.ReadFromCbs(&value);
break;
- case kInitialMaxData:
+ case TransportParameters::kInitialMaxData:
parse_success = out->initial_max_data.ReadFromCbs(&value);
break;
- case kInitialMaxStreamDataBidiLocal:
+ case TransportParameters::kInitialMaxStreamDataBidiLocal:
parse_success =
out->initial_max_stream_data_bidi_local.ReadFromCbs(&value);
break;
- case kInitialMaxStreamDataBidiRemote:
+ case TransportParameters::kInitialMaxStreamDataBidiRemote:
parse_success =
out->initial_max_stream_data_bidi_remote.ReadFromCbs(&value);
break;
- case kInitialMaxStreamDataUni:
+ case TransportParameters::kInitialMaxStreamDataUni:
parse_success = out->initial_max_stream_data_uni.ReadFromCbs(&value);
break;
- case kInitialMaxStreamsBidi:
+ case TransportParameters::kInitialMaxStreamsBidi:
parse_success = out->initial_max_streams_bidi.ReadFromCbs(&value);
break;
- case kInitialMaxStreamsUni:
+ case TransportParameters::kInitialMaxStreamsUni:
parse_success = out->initial_max_streams_uni.ReadFromCbs(&value);
break;
- case kAckDelayExponent:
+ case TransportParameters::kAckDelayExponent:
parse_success = out->ack_delay_exponent.ReadFromCbs(&value);
break;
- case kMaxAckDelay:
+ case TransportParameters::kMaxAckDelay:
parse_success = out->max_ack_delay.ReadFromCbs(&value);
break;
- case kDisableMigration:
+ case TransportParameters::kDisableMigration:
if (out->disable_migration) {
QUIC_DLOG(ERROR) << "Received a second disable migration";
return false;
@@ -638,7 +638,7 @@ bool ParseTransportParameters(const uint
}
out->disable_migration = true;
break;
- case kPreferredAddress: {
+ case TransportParameters::kPreferredAddress: {
uint16_t ipv4_port, ipv6_port;
in_addr ipv4_address;
in6_addr ipv6_address;
@@ -692,7 +692,7 @@ bool ParseTransportParameters(const uint
QuicMakeUnique<TransportParameters::PreferredAddress>(
preferred_address);
} break;
- case kGoogleQuicParam: {
+ case TransportParameters::kGoogleQuicParam: {
if (out->google_quic_params) {
QUIC_DLOG(ERROR) << "Received a second Google parameter";
return false;
@@ -701,7 +701,7 @@ bool ParseTransportParameters(const uint
reinterpret_cast<const char*>(CBS_data(&value)), CBS_len(&value));
out->google_quic_params = CryptoFramer::ParseMessage(serialized_params);
} break;
- case kGoogleQuicVersion: {
+ case TransportParameters::kGoogleQuicVersion: {
if (!CBS_get_u32(&value, &out->version)) {
QUIC_DLOG(ERROR) << "Failed to parse Google version extension";
return false;
diff -up chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/quic_socket_address_coder.cc.quiche-compile-fix chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/quic_socket_address_coder.cc
--- chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/quic_socket_address_coder.cc.quiche-compile-fix 2019-08-14 09:59:19.139902052 +0200
+++ chromium-76.0.3809.100/net/third_party/quiche/src/quic/core/quic_socket_address_coder.cc 2019-08-14 09:59:33.132041535 +0200
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <string>
-
#include "net/third_party/quiche/src/quic/core/quic_socket_address_coder.h"
+#include <cstring>
+#include <string>
+#include <vector>
+
namespace quic {
namespace {