*error_details = "Missing " + QuicUtils::TagToString(tag_);
break;
case QUIC_NO_ERROR:
+ DVLOG(1) << "Received Connection Option tags from receiver.";
has_receive_values_ = true;
for (size_t i = 0; i < received_tags_length; ++i) {
receive_values_.push_back(received_tags[i]);
QuicConfig::QuicConfig()
: congestion_feedback_(kCGST, PRESENCE_REQUIRED),
- congestion_options_(kCOPT, PRESENCE_OPTIONAL),
+ connection_options_(kCOPT, PRESENCE_OPTIONAL),
loss_detection_(kLOSS, PRESENCE_OPTIONAL),
idle_connection_state_lifetime_seconds_(kICSL, PRESENCE_REQUIRED),
keepalive_timeout_seconds_(kKATO, PRESENCE_OPTIONAL),
max_time_before_crypto_handshake_(QuicTime::Delta::Zero()),
initial_congestion_window_(kSWND, PRESENCE_OPTIONAL),
initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL),
- // TODO(rjshade): Make this PRESENCE_REQUIRED when retiring
- // QUIC_VERSION_17.
+ // TODO(rjshade): Make this PRESENCE_REQUIRED when QUIC_VERSION_16 is
+ // retired.
initial_flow_control_window_bytes_(kIFCW, PRESENCE_OPTIONAL),
// TODO(rjshade): Make this PRESENCE_REQUIRED when retiring
// QUIC_VERSION_19.
initial_stream_flow_control_window_bytes_(kSFCW, PRESENCE_OPTIONAL),
// TODO(rjshade): Make this PRESENCE_REQUIRED when retiring
// QUIC_VERSION_19.
- initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL) {
+ initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL),
+ socket_receive_buffer_(kSRBF, PRESENCE_OPTIONAL) {
}
QuicConfig::~QuicConfig() {}
return congestion_feedback_.GetTag();
}
-void QuicConfig::SetCongestionOptionsToSend(
- const QuicTagVector& congestion_options) {
- congestion_options_.SetSendValues(congestion_options);
+void QuicConfig::SetConnectionOptionsToSend(
+ const QuicTagVector& connection_options) {
+ connection_options_.SetSendValues(connection_options);
+}
+
+bool QuicConfig::HasReceivedConnectionOptions() const {
+ return connection_options_.HasReceivedValues();
}
-bool QuicConfig::HasReceivedCongestionOptions() const {
- return congestion_options_.HasReceivedValues();
+QuicTagVector QuicConfig::ReceivedConnectionOptions() const {
+ return connection_options_.GetReceivedValues();
}
-QuicTagVector QuicConfig::ReceivedCongestionOptions() const {
- return congestion_options_.GetReceivedValues();
+bool QuicConfig::HasSendConnectionOptions() const {
+ return connection_options_.HasSendValues();
+}
+
+QuicTagVector QuicConfig::SendConnectionOptions() const {
+ return connection_options_.GetSendValues();
}
void QuicConfig::SetLossDetectionToSend(QuicTag loss_detection) {
return initial_session_flow_control_window_bytes_.GetReceivedValue();
}
+void QuicConfig::SetSocketReceiveBufferToSend(uint32 tcp_receive_window) {
+ socket_receive_buffer_.SetSendValue(tcp_receive_window);
+}
+
+uint32 QuicConfig::GetSocketReceiveBufferToSend() const {
+ return socket_receive_buffer_.GetSendValue();
+}
+
+bool QuicConfig::HasReceivedSocketReceiveBuffer() const {
+ return socket_receive_buffer_.HasReceivedValue();
+}
+
+uint32 QuicConfig::ReceivedSocketReceiveBuffer() const {
+ return socket_receive_buffer_.GetReceivedValue();
+}
+
bool QuicConfig::negotiated() {
// TODO(ianswett): Add the negotiated parameters once and iterate over all
// of them in negotiated, ToHandshakeMessage, ProcessClientHello, and
void QuicConfig::SetDefaults() {
QuicTagVector congestion_feedback;
- if (FLAGS_enable_quic_pacing) {
- congestion_feedback.push_back(kPACE);
- }
congestion_feedback.push_back(kQBIC);
congestion_feedback_.set(congestion_feedback, kQBIC);
idle_connection_state_lifetime_seconds_.set(kDefaultTimeoutSecs,
SetInitialSessionFlowControlWindowToSend(kDefaultFlowControlSendWindow);
}
-void QuicConfig::EnablePacing(bool enable_pacing) {
- QuicTagVector congestion_feedback;
- if (enable_pacing) {
- congestion_feedback.push_back(kPACE);
- }
- congestion_feedback.push_back(kQBIC);
- congestion_feedback_.set(congestion_feedback, kQBIC);
-}
-
void QuicConfig::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
congestion_feedback_.ToHandshakeMessage(out);
idle_connection_state_lifetime_seconds_.ToHandshakeMessage(out);
initial_flow_control_window_bytes_.ToHandshakeMessage(out);
initial_stream_flow_control_window_bytes_.ToHandshakeMessage(out);
initial_session_flow_control_window_bytes_.ToHandshakeMessage(out);
- congestion_options_.ToHandshakeMessage(out);
+ socket_receive_buffer_.ToHandshakeMessage(out);
+ connection_options_.ToHandshakeMessage(out);
}
QuicErrorCode QuicConfig::ProcessPeerHello(
peer_hello, hello_type, error_details);
}
if (error == QUIC_NO_ERROR) {
+ error = socket_receive_buffer_.ProcessPeerHello(
+ peer_hello, hello_type, error_details);
+ }
+ if (error == QUIC_NO_ERROR) {
error = loss_detection_.ProcessPeerHello(
peer_hello, hello_type, error_details);
}
if (error == QUIC_NO_ERROR) {
- error = congestion_options_.ProcessPeerHello(
+ error = connection_options_.ProcessPeerHello(
peer_hello, hello_type, error_details);
}
return error;