commit | e8955cf2f5c6603111eb39b34990f26bc053e911 | [log] [tgz] |
---|---|---|
author | Bence Béky <bnc@chromium.org> | Tue Jan 02 17:31:29 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Jan 03 16:43:23 2018 |
tree | 88b6da9cbf26f77c3585e8ac6de330f3a3c1dc79 | |
parent | b6221a0af8eb24a0c16024d4e142d39cfa2682ad [diff] |
Make HttpStreamFactoryImpl::Job claim pushed streams. Motivation: Suppose the server pushes a stream and then cancels it. Consider the following three events: (A) HttpStreamFactoryImpl::Job calls Http2PushPromiseIndex::Find() to look for the SpdySession that has an unclaimed pushed stream for the request URL. (B) SpdyHttpStream calls GetPushStream() on that SpdySession instance. (C) SpdySession deletes the pushed stream when it receives the RST_STREAM frame from the server, before the response is pushed. (B) always happens after (A), and it involves a PostTask (see bug for details). If (C) happens after (B), then the request fails with a user-visible error (that upper layers like HttpNetworkTransaction might intercept and do a retry). If (C) happens after (A) but before (B), then currently, the request is sent out on the SpdySession which might not be used if there was not a pushed stream on it. That is, the server is allowed to hijack the request, and see the request headers, by pushing a stream and then closing it at the right time. After this CL, the request will fail in this case as well, with a new error code. Details: Rename Http2PushPromiseIndex::FindSession() to ClaimPushedStream() and make it unregister the pushed stream if found. Record pushed stream ID in HttpStreamFactoryImpl::Job, pass it on to SpdyHttpStream, then back to SpdySession::GetPushStream(). Fail request with new error code ERR_SPDY_PUSHED_STREAM_NOT_AVAILABLE if pushed stream was cancelled in the meanwhile. Add new SpdySessionTest for modified GetPushStream() behavior. Add SpdyNetworkTransactionTest to cover the case that the server cancels the pushed stream after it is claimed but before SpdyHttpStream calls SpdySession->GetPushStream(). Bug: 776415 Change-Id: I14150b933b09ee5c96722aa0fb2392afbcbb65b1 Reviewed-on: https://chromium-review.googlesource.com/829993 Reviewed-by: Helen Li <xunjieli@chromium.org> Commit-Queue: Bence Béky <bnc@chromium.org> Cr-Commit-Position: refs/heads/master@{#526717}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .