Mercurial > hg > orthanc
comparison OrthancFramework/Sources/HttpServer/FilesystemHttpSender.cpp @ 5406:aaf7c49a9ddc am-http-compression
tentative to implement smart HTTP compression with detection of transfer syntax
author | Alain Mazy <am@osimis.io> |
---|---|
date | Sat, 04 Nov 2023 13:42:30 +0100 |
parents | 0ea402b4d901 |
children |
comparison
equal
deleted
inserted
replaced
5405:62bb63346185 | 5406:aaf7c49a9ddc |
---|---|
20 * <http://www.gnu.org/licenses/>. | 20 * <http://www.gnu.org/licenses/>. |
21 **/ | 21 **/ |
22 | 22 |
23 #include "../PrecompiledHeaders.h" | 23 #include "../PrecompiledHeaders.h" |
24 #include "FilesystemHttpSender.h" | 24 #include "FilesystemHttpSender.h" |
25 #include "../SystemToolbox.h" | |
25 | 26 |
26 #include "../OrthancException.h" | 27 #include "../OrthancException.h" |
27 | 28 |
28 static const size_t CHUNK_SIZE = 64 * 1024; // Use 64KB chunks | 29 static const size_t CHUNK_SIZE = 64 * 1024; // Use 64KB chunks |
29 | 30 |
56 | 57 |
57 FilesystemHttpSender::FilesystemHttpSender(const std::string& path, | 58 FilesystemHttpSender::FilesystemHttpSender(const std::string& path, |
58 MimeType contentType) | 59 MimeType contentType) |
59 { | 60 { |
60 SetContentType(contentType); | 61 SetContentType(contentType); |
62 SetContentCompression(SystemToolbox::GuessContentCompression(contentType)); | |
63 Initialize(path); | |
64 } | |
65 | |
66 FilesystemHttpSender::FilesystemHttpSender(const std::string& path, | |
67 MimeType contentType, | |
68 ContentCompression contentCompression) | |
69 { | |
70 SetContentType(contentType); | |
71 SetContentCompression(SystemToolbox::GuessContentCompression(contentType)); | |
61 Initialize(path); | 72 Initialize(path); |
62 } | 73 } |
63 | 74 |
64 FilesystemHttpSender::FilesystemHttpSender(const FilesystemStorage& storage, | 75 FilesystemHttpSender::FilesystemHttpSender(const FilesystemStorage& storage, |
65 const std::string& uuid) | 76 const std::string& uuid) |