Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: net/quic/quartc/quartc_session.cc

Issue 2913413002: Groundwork for cancelling quartc streams after a deadline is exceeded. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quartc/quartc_session.h ('k') | net/quic/quartc/quartc_session_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quartc/quartc_session.cc
diff --git a/net/quic/quartc/quartc_session.cc b/net/quic/quartc/quartc_session.cc
index fb14ffa714f85b46cd6fc033b8b01ad18d94671f..7e5c5af676a460c119411b6db2c0eb845f3d08f0 100644
--- a/net/quic/quartc/quartc_session.cc
+++ b/net/quic/quartc/quartc_session.cc
@@ -174,6 +174,21 @@ void QuartcSession::CloseStream(QuicStreamId stream_id) {
QuicSession::CloseStream(stream_id);
}
+void QuartcSession::CancelStream(QuicStreamId stream_id) {
+ ResetStream(stream_id, QuicRstStreamErrorCode::QUIC_STREAM_CANCELLED);
+}
+
+void QuartcSession::ResetStream(QuicStreamId stream_id,
+ QuicRstStreamErrorCode error) {
+ if (!IsOpenStream(stream_id)) {
+ return;
+ }
+ QuicStream* stream = QuicSession::GetOrCreateStream(stream_id);
+ if (stream) {
+ stream->Reset(error);
+ }
+}
+
void QuartcSession::OnConnectionClosed(QuicErrorCode error,
const string& error_details,
ConnectionCloseSource source) {
@@ -289,10 +304,15 @@ std::unique_ptr<QuartcStream> QuartcSession::CreateDataStream(
// priority.
write_blocked_streams()->RegisterStream(stream->id(), priority);
- // Incoming streams need to be registered with the session_delegate_.
if (IsIncomingStream(id)) {
DCHECK(session_delegate_);
+ // Incoming streams need to be registered with the session_delegate_.
session_delegate_->OnIncomingStream(stream.get());
+ // Quartc doesn't send on incoming streams.
+ stream->set_fin_sent(true);
+ } else {
+ // Quartc doesn't receive on outgoing streams.
+ stream->set_fin_received(true);
}
}
return stream;
« no previous file with comments | « net/quic/quartc/quartc_session.h ('k') | net/quic/quartc/quartc_session_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698