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

Unified Diff: net/spdy/spdy_session.h

Issue 8230037: Send PING to check the status of the SPDY connection. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 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
Index: net/spdy/spdy_session.h
===================================================================
--- net/spdy/spdy_session.h (revision 104856)
+++ net/spdy/spdy_session.h (working copy)
@@ -104,6 +104,9 @@
// NOTE: This function can have false negatives on some platforms.
bool VerifyDomainAuthentication(const std::string& domain);
+ // Send the PING frame for |stream_id|.
+ int WritePingFrame(spdy::SpdyStreamId stream_id);
+
// Send the SYN frame for |stream_id|.
int WriteSynStream(
spdy::SpdyStreamId stream_id,
@@ -195,6 +198,14 @@
return !active_streams_.empty();
}
+ // Returns true if we have received a ping response from server for the ping
+ // message we had sent.
+ bool DidLastPingWork() const {
+ if (sent_ping_)
willchan no longer on Chromium 2011/10/12 05:41:06 This isn't good enough, you're going to need to tr
ramant (doing other things) 2011/10/13 21:41:14 Done.
+ return received_ping_;
+ return true;
+ }
+
// Access to the number of active and pending streams. These are primarily
// available for testing and diagnostics.
size_t num_active_streams() const { return active_streams_.size(); }
@@ -271,6 +282,7 @@
const linked_ptr<spdy::SpdyHeaderBlock>& headers);
void OnRst(const spdy::SpdyRstStreamControlFrame& frame);
void OnGoAway(const spdy::SpdyGoAwayControlFrame& frame);
+ void OnPing(const spdy::SpdyPingControlFrame& frame);
void OnSettings(const spdy::SpdySettingsControlFrame& frame);
void OnWindowUpdate(const spdy::SpdyWindowUpdateControlFrame& frame);
@@ -431,6 +443,9 @@
// frame.
int stalled_streams_; // Count of streams that were ever stalled.
+ bool sent_ping_; // Did this session send a ping message.
+ bool received_ping_; // Did this session receive a ping message.
+
// Initial send window size for the session; can be changed by an
// arriving SETTINGS frame; newly created streams use this value for the
// initial send window size.

Powered by Google App Engine
This is Rietveld 408576698