Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / net / quic / quic_session.cc
index 9be3a3b..35495df 100644 (file)
@@ -60,10 +60,6 @@ class VisitorShim : public QuicConnectionVisitorInterface {
     session_->OnSuccessfulVersionNegotiation(version);
   }
 
-  virtual void OnConfigNegotiated() OVERRIDE {
-    session_->OnConfigNegotiated();
-  }
-
   virtual void OnConnectionClosed(
       QuicErrorCode error, bool from_peer) OVERRIDE {
     session_->OnConnectionClosed(error, from_peer);
@@ -241,7 +237,7 @@ void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) {
           QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED);
     }
   }
-  stream->OnStreamReset(frame.error_code);
+  stream->OnStreamReset(frame);
 }
 
 void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) {
@@ -324,8 +320,9 @@ size_t QuicSession::WriteHeaders(QuicStreamId id,
 }
 
 void QuicSession::SendRstStream(QuicStreamId id,
-                                QuicRstStreamErrorCode error) {
-  connection_->SendRstStream(id, error);
+                                QuicRstStreamErrorCode error,
+                                QuicStreamOffset bytes_written) {
+  connection_->SendRstStream(id, error, bytes_written);
   CloseStreamInner(id, true);
 }
 
@@ -348,6 +345,12 @@ void QuicSession::CloseStreamInner(QuicStreamId stream_id,
     return;
   }
   QuicDataStream* stream = it->second;
+
+  // Tell the stream that a RST has been sent.
+  if (locally_reset) {
+    stream->set_rst_sent(true);
+  }
+
   if (connection_->version() <= QUIC_VERSION_12 &&
       connection_->connected() && !stream->headers_decompressed()) {
     // If the stream is being closed locally (for example a client cancelling
@@ -523,7 +526,7 @@ QuicDataStream* QuicSession::GetIncomingDataStream(QuicStreamId stream_id) {
 
   if (goaway_sent_) {
     // We've already sent a GoAway
-    SendRstStream(stream_id, QUIC_STREAM_PEER_GOING_AWAY);
+    SendRstStream(stream_id, QUIC_STREAM_PEER_GOING_AWAY, 0);
     return NULL;
   }