| Index: net/tools/quic/quic_dispatcher.cc
|
| diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
|
| index c06eb6097c7f406cabc7757a4b54d87ab354db70..458ed019d254222560151e6c32f2a20b55dfc85b 100644
|
| --- a/net/tools/quic/quic_dispatcher.cc
|
| +++ b/net/tools/quic/quic_dispatcher.cc
|
| @@ -27,8 +27,7 @@ using std::make_pair;
|
| class DeleteSessionsAlarm : public EpollAlarm {
|
| public:
|
| explicit DeleteSessionsAlarm(QuicDispatcher* dispatcher)
|
| - : dispatcher_(dispatcher) {
|
| - }
|
| + : dispatcher_(dispatcher) {}
|
|
|
| virtual int64 OnAlarm() OVERRIDE {
|
| EpollAlarm::OnAlarm();
|
| @@ -43,8 +42,7 @@ class DeleteSessionsAlarm : public EpollAlarm {
|
| class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
|
| public:
|
| explicit QuicFramerVisitor(QuicDispatcher* dispatcher)
|
| - : dispatcher_(dispatcher),
|
| - connection_id_(0) {}
|
| + : dispatcher_(dispatcher), connection_id_(0) {}
|
|
|
| // QuicFramerVisitorInterface implementation
|
| virtual void OnPacket() OVERRIDE {}
|
| @@ -94,9 +92,7 @@ class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
|
| DCHECK(false);
|
| return false;
|
| }
|
| - virtual void OnRevivedPacket() OVERRIDE {
|
| - DCHECK(false);
|
| - }
|
| + virtual void OnRevivedPacket() OVERRIDE { DCHECK(false); }
|
| virtual void OnFecProtectedPayload(StringPiece /*payload*/) OVERRIDE {
|
| DCHECK(false);
|
| }
|
| @@ -127,7 +123,7 @@ class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
|
| return false;
|
| }
|
| virtual bool OnConnectionCloseFrame(
|
| - const QuicConnectionCloseFrame & /*frame*/) OVERRIDE {
|
| + const QuicConnectionCloseFrame& /*frame*/) OVERRIDE {
|
| DCHECK(false);
|
| return false;
|
| }
|
| @@ -135,8 +131,8 @@ class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
|
| DCHECK(false);
|
| return false;
|
| }
|
| - virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/)
|
| - OVERRIDE {
|
| + virtual bool OnWindowUpdateFrame(
|
| + const QuicWindowUpdateFrame& /*frame*/) OVERRIDE {
|
| DCHECK(false);
|
| return false;
|
| }
|
| @@ -144,12 +140,8 @@ class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
|
| DCHECK(false);
|
| return false;
|
| }
|
| - virtual void OnFecData(const QuicFecData& /*fec*/) OVERRIDE {
|
| - DCHECK(false);
|
| - }
|
| - virtual void OnPacketComplete() OVERRIDE {
|
| - DCHECK(false);
|
| - }
|
| + virtual void OnFecData(const QuicFecData& /*fec*/) OVERRIDE { DCHECK(false); }
|
| + virtual void OnPacketComplete() OVERRIDE { DCHECK(false); }
|
|
|
| private:
|
| QuicDispatcher* dispatcher_;
|
| @@ -191,7 +183,8 @@ void QuicDispatcher::Initialize(int fd) {
|
| // supported_versions_no_flow_control_ vector.
|
| QuicVersionVector::iterator it =
|
| find(supported_versions_no_flow_control_.begin(),
|
| - supported_versions_no_flow_control_.end(), QUIC_VERSION_17);
|
| + supported_versions_no_flow_control_.end(),
|
| + QUIC_VERSION_17);
|
| if (it != supported_versions_no_flow_control_.end()) {
|
| supported_versions_no_flow_control_.erase(
|
| supported_versions_no_flow_control_.begin(), it + 1);
|
| @@ -231,8 +224,8 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
|
| // session for it. All initial packets for a new connection are required to
|
| // have the flag set. Otherwise it may be a stray packet.
|
| if (header.version_flag) {
|
| - session = CreateQuicSession(connection_id, current_server_address_,
|
| - current_client_address_);
|
| + session = CreateQuicSession(
|
| + connection_id, current_server_address_, current_client_address_);
|
| }
|
|
|
| if (session == NULL) {
|
| @@ -247,8 +240,8 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
|
| }
|
|
|
| // Use the version in the packet if possible, otherwise assume the latest.
|
| - QuicVersion version = header.version_flag ? header.versions.front() :
|
| - supported_versions_.front();
|
| + QuicVersion version = header.version_flag ? header.versions.front()
|
| + : supported_versions_.front();
|
| time_wait_list_manager_->AddConnectionIdToTimeWait(
|
| connection_id, version, NULL);
|
| DCHECK(time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id));
|
| @@ -280,11 +273,10 @@ void QuicDispatcher::OnUnauthenticatedHeader(const QuicPacketHeader& header) {
|
| void QuicDispatcher::CleanUpSession(SessionMap::iterator it) {
|
| QuicConnection* connection = it->second->connection();
|
| QuicEncryptedPacket* connection_close_packet =
|
| - connection->ReleaseConnectionClosePacket();
|
| + connection->ReleaseConnectionClosePacket();
|
| write_blocked_list_.erase(connection);
|
| - time_wait_list_manager_->AddConnectionIdToTimeWait(it->first,
|
| - connection->version(),
|
| - connection_close_packet);
|
| + time_wait_list_manager_->AddConnectionIdToTimeWait(
|
| + it->first, connection->version(), connection_close_packet);
|
| session_map_.erase(it);
|
| }
|
|
|
| @@ -339,14 +331,13 @@ void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id,
|
| return;
|
| }
|
|
|
| - DLOG_IF(INFO, error != QUIC_NO_ERROR) << "Closing connection ("
|
| - << connection_id
|
| - << ") due to error: "
|
| - << QuicUtils::ErrorToString(error);
|
| + DLOG_IF(INFO, error != QUIC_NO_ERROR)
|
| + << "Closing connection (" << connection_id
|
| + << ") due to error: " << QuicUtils::ErrorToString(error);
|
|
|
| if (closed_session_list_.empty()) {
|
| - epoll_server_->RegisterAlarmApproximateDelta(
|
| - 0, delete_sessions_alarm_.get());
|
| + epoll_server_->RegisterAlarmApproximateDelta(0,
|
| + delete_sessions_alarm_.get());
|
| }
|
| closed_session_list_.push_back(it->second);
|
| CleanUpSession(it);
|
| @@ -384,14 +375,21 @@ QuicConnection* QuicDispatcher::CreateQuicConnection(
|
| // If we have disabled per-stream flow control, then don't allow new
|
| // connections to talk QUIC_VERSION_17 or higher.
|
| if (FLAGS_enable_quic_stream_flow_control_2) {
|
| - return new QuicConnection(connection_id, client_address, helper_.get(),
|
| - writer_.get(), true, supported_versions_,
|
| + return new QuicConnection(connection_id,
|
| + client_address,
|
| + helper_.get(),
|
| + writer_.get(),
|
| + true,
|
| + supported_versions_,
|
| initial_flow_control_window_bytes_);
|
| } else {
|
| DVLOG(1)
|
| << "Flow control disabled, creating QuicDispatcher WITHOUT version 17";
|
| - return new QuicConnection(connection_id, client_address, helper_.get(),
|
| - writer_.get(), true,
|
| + return new QuicConnection(connection_id,
|
| + client_address,
|
| + helper_.get(),
|
| + writer_.get(),
|
| + true,
|
| supported_versions_no_flow_control_,
|
| initial_flow_control_window_bytes_);
|
| }
|
|
|