diff Core/HttpServer/FilesystemHttpHandler.cpp @ 1515:c94353fbd4e9

cont http compression
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 10 Aug 2015 17:18:36 +0200
parents 8dc80ba768aa
children 4f8c8ef114db
line wrap: on
line diff
--- a/Core/HttpServer/FilesystemHttpHandler.cpp	Mon Aug 10 16:43:59 2015 +0200
+++ b/Core/HttpServer/FilesystemHttpHandler.cpp	Mon Aug 10 17:18:36 2015 +0200
@@ -50,6 +50,7 @@
 
 
   static void OutputDirectoryContent(HttpOutput& output,
+                                     const IHttpHandler::Arguments& headers,
                                      const UriComponents& uri,
                                      const boost::filesystem::path& p)
   {
@@ -104,7 +105,7 @@
     s += "  </body>";
     s += "</html>";
 
-    output.SendBody(s);
+    output.SendBody(s, IHttpHandler::GetPreferredCompression(headers, s.size()));
   }
 
 
@@ -155,7 +156,7 @@
 
     if (fs::exists(p) && fs::is_regular_file(p))
     {
-      FilesystemHttpSender(p).Send(output);
+      FilesystemHttpSender(p).Send(output);   // TODO COMPRESSION
 
       //output.AnswerFileAutodetectContentType(p.string());
     }
@@ -163,7 +164,7 @@
              fs::exists(p) && 
              fs::is_directory(p))
     {
-      OutputDirectoryContent(output, uri, p);
+      OutputDirectoryContent(output, headers, uri, p);
     }
     else
     {