diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 18:25:30 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 18:25:30 +0000 |
commit | 84b562f4cc01dc7a292ac4ff26703d4e3ac3ce29 (patch) | |
tree | 1918673440624ab2d9874adf3b55f1a1203e70c4 | |
parent | c6d500ce72b7bcc706b2f48921736231ef157aad (diff) | |
download | chromium_src-84b562f4cc01dc7a292ac4ff26703d4e3ac3ce29.zip chromium_src-84b562f4cc01dc7a292ac4ff26703d4e3ac3ce29.tar.gz chromium_src-84b562f4cc01dc7a292ac4ff26703d4e3ac3ce29.tar.bz2 |
Robustness improvements on the X-Associated-Content header.
If we get a header which doesn't look like it contains a
parseable URL, log an error and drop it (instead of inserting
it into the pending_streams_ list).
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/420002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32629 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/flip/flip_session.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc index 82aa9b8..8164f1d 100644 --- a/net/flip/flip_session.cc +++ b/net/flip/flip_session.cc @@ -694,9 +694,13 @@ void FlipSession::OnSynReply(const flip::FlipSynReplyControlFrame* frame, break; url = url.substr(pos + 2); GURL gurl(url); - pending_streams_[gurl.PathForRequest()] = NULL; + std::string path = gurl.PathForRequest(); + if (path.length()) + pending_streams_[path] = NULL; + else + LOG(INFO) << "Invalid X-Associated-Content path: " << url; start = end + 2; - } while (end < content.length()); + } while (start < content.length()); } FlipStream* stream = active_streams_[stream_id]; @@ -709,6 +713,7 @@ void FlipSession::OnControl(const flip::FlipControlFrame* frame) { if (type == flip::SYN_STREAM || type == flip::SYN_REPLY) { if (!flip_framer_.ParseHeaderBlock(frame, &headers)) { LOG(WARNING) << "Could not parse Flip Control Frame Header"; + // TODO(mbelshe): Error the session? return; } } |