blob: e84516899b5be4a0272b602ed52471b93a14a8a4 [file] [log] [blame]
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/tools/quic/quic_spdy_server_stream_base.h"
#include "net/quic/core/quic_error_codes.h"
#include "net/quic/platform/api/quic_logging.h"
namespace net {
QuicSpdyServerStreamBase::QuicSpdyServerStreamBase(QuicStreamId id,
QuicSpdySession* session)
: QuicSpdyStream(id, session) {}
void QuicSpdyServerStreamBase::CloseWriteSide() {
if (!fin_received() && !rst_received() && sequencer()->ignore_read_data() &&
!rst_sent()) {
// Early cancel the stream if it has stopped reading before receiving FIN
// or RST.
DCHECK(fin_sent());
// Tell the peer to stop sending further data.
QUIC_DVLOG(0) << " Server: Send QUIC_STREAM_NO_ERROR on stream " << id();
Reset(QUIC_STREAM_NO_ERROR);
}
QuicSpdyStream::CloseWriteSide();
}
} // namespace net