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

Unified Diff: net/tools/quic/quic_spdy_server_stream.cc

Issue 1028923002: Make some changes to the QuicInMemory server to clarify the interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 5 years, 9 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
« no previous file with comments | « net/tools/quic/quic_in_memory_cache_test.cc ('k') | net/tools/quic/quic_spdy_server_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_spdy_server_stream.cc
diff --git a/net/tools/quic/quic_spdy_server_stream.cc b/net/tools/quic/quic_spdy_server_stream.cc
index cf85933c6d124ee5b1d627ee0900f1f3b8c73cee..5937d6d6253a50e3024fb81d20e5f3fa1f06309e 100644
--- a/net/tools/quic/quic_spdy_server_stream.cc
+++ b/net/tools/quic/quic_spdy_server_stream.cc
@@ -9,6 +9,7 @@
#include "net/spdy/spdy_framer.h"
#include "net/tools/quic/quic_in_memory_cache.h"
#include "net/tools/quic/spdy_utils.h"
+#include "url/gurl.h"
using base::StringPiece;
using std::string;
@@ -90,8 +91,15 @@ void QuicSpdyServerStream::ParseRequestHeaders() {
void QuicSpdyServerStream::SendResponse() {
// Find response in cache. If not found, send error response.
+ GURL url(headers_.request_uri().as_string());
+ if (!url.is_valid()) {
+ SendErrorResponse();
+ return;
+ }
const QuicInMemoryCache::Response* response =
- QuicInMemoryCache::GetInstance()->GetResponse(headers_);
+ QuicInMemoryCache::GetInstance()->GetResponse(
+ url.host(),
+ url.PathForRequest());
if (response == nullptr) {
SendErrorResponse();
return;
« no previous file with comments | « net/tools/quic/quic_in_memory_cache_test.cc ('k') | net/tools/quic/quic_spdy_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698