Index: net/spdy/spdy_http_stream.cc |
=================================================================== |
--- net/spdy/spdy_http_stream.cc (revision 104856) |
+++ net/spdy/spdy_http_stream.cc (working copy) |
@@ -26,6 +26,7 @@ |
SpdyHttpStream::SpdyHttpStream(SpdySession* spdy_session, |
bool direct) |
: ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_factory_(this)), |
+ ALLOW_THIS_IN_INITIALIZER_LIST(ping_method_factory_(this)), |
stream_(NULL), |
spdy_session_(spdy_session), |
response_info_(NULL), |
@@ -267,11 +268,24 @@ |
} |
bool SpdyHttpStream::OnSendHeadersComplete(int status) { |
+ // Send the spdy ping message here. |
+ stream_->SendPing(); |
+ const int kPingTimeMs = 1000; |
+ MessageLoop::current()->PostDelayedTask(FROM_HERE, ping_method_factory_. |
+ NewRunnableMethod(&SpdyHttpStream::CheckPingResponse), |
+ kPingTimeMs); |
+ |
if (user_callback_) |
DoCallback(status); |
return request_body_stream_.get() == NULL; |
} |
+void SpdyHttpStream::CheckPingResponse() { |
+ // TODO(rtenneti): we should send a different error code. |
+ if (!spdy_session_->DidLastPingWork()) |
+ DoCallback(ERR_CONNECTION_ABORTED); |
willchan no longer on Chromium
2011/10/12 05:41:06
Need a different error code.
ramant (doing other things)
2011/10/13 21:41:14
Done.
|
+} |
+ |
int SpdyHttpStream::OnSendBody() { |
CHECK(request_body_stream_.get()); |