#include "base/logging.h"
#include "net/quic/quic_connection.h"
+#include "net/quic/quic_flags.h"
#include "net/quic/quic_spdy_server_stream.h"
#include "net/quic/reliable_quic_stream.h"
namespace net {
-QuicServerSession::QuicServerSession(const QuicConfig& config,
- QuicConnection* connection,
- QuicServerSessionVisitor* visitor)
+QuicServerSession::QuicServerSession(
+ const QuicConfig& config,
+ QuicConnection* connection,
+ QuicPerConnectionPacketWriter* connection_packet_writer,
+ QuicServerSessionVisitor* visitor)
: QuicSession(connection, config),
+ connection_packet_writer_(connection_packet_writer),
visitor_(visitor) {}
QuicServerSession::~QuicServerSession() {}
void QuicServerSession::InitializeSession(
const QuicCryptoServerConfig& crypto_config) {
+ QuicSession::InitializeSession();
crypto_stream_.reset(CreateQuicCryptoServerStream(crypto_config));
}
return new QuicCryptoServerStream(crypto_config, this);
}
+void QuicServerSession::OnConfigNegotiated() {
+ QuicSession::OnConfigNegotiated();
+ if (!FLAGS_enable_quic_fec ||
+ !config()->HasReceivedConnectionOptions() ||
+ !ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) {
+ return;
+ }
+ // kFHDR config maps to FEC protection always for headers stream.
+ // TODO(jri): Add crypto stream in addition to headers for kHDR.
+ headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS);
+}
+
void QuicServerSession::OnConnectionClosed(QuicErrorCode error,
bool from_peer) {
QuicSession::OnConnectionClosed(error, from_peer);