Index: net/tools/flip_server/flip_in_mem_edsm_server.cc |
=================================================================== |
--- net/tools/flip_server/flip_in_mem_edsm_server.cc (revision 43504) |
+++ net/tools/flip_server/flip_in_mem_edsm_server.cc (working copy) |
@@ -3,7 +3,7 @@ |
// found in the LICENSE file. |
#include <dirent.h> |
-#include <linux/tcp.h> // For TCP_NODELAY |
+#include <netinet/tcp.h> // For TCP_NODELAY on some distros, this needs to be <linux/tcp.h> |
Mike Belshe
2010/04/02 19:41:28
nit: 80 columns.
|
#include <sys/socket.h> |
#include <sys/types.h> |
#include <unistd.h> |
@@ -194,12 +194,18 @@ |
// Encode the URL. |
string EncodeURL(string uri, string host, string method) { |
+ string filename; |
if (!FLAGS_need_to_encode_url) { |
// TODO(mbelshe): if uri is fully qualified, need to strip protocol/host. |
- return string(method + "_" + uri); |
+ if (uri[0] == '/') { |
+ // uri is not fully qualified. |
+ filename = method + "_/" + host + uri; |
+ } else { |
+ filename = method + "_" + uri; |
+ } |
+ return filename; |
} |
- string filename; |
if (uri[0] == '/') { |
// uri is not fully qualified. |
filename = net::UrlToFilenameEncoder::Encode( |