comparison Core/HttpServer/FilesystemHttpSender.h @ 1525:f9b0169eb6bb

testing
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 11 Aug 2015 17:50:38 +0200
parents c388502a066d
children b1291df2f780
comparison
equal deleted inserted replaced
1524:4a0c2eedceb6 1525:f9b0169eb6bb
44 private: 44 private:
45 std::ifstream file_; 45 std::ifstream file_;
46 uint64_t size_; 46 uint64_t size_;
47 std::string chunk_; 47 std::string chunk_;
48 size_t chunkSize_; 48 size_t chunkSize_;
49 CompressionType sourceCompression_;
50 HttpCompression targetCompression_;
51
52 std::auto_ptr<BufferHttpSender> uncompressed_;
53 49
54 void Initialize(const boost::filesystem::path& path); 50 void Initialize(const boost::filesystem::path& path);
55 51
56 public: 52 public:
57 FilesystemHttpSender(const std::string& path) 53 FilesystemHttpSender(const std::string& path)
68 const std::string& uuid) 64 const std::string& uuid)
69 { 65 {
70 Initialize(storage.GetPath(uuid)); 66 Initialize(storage.GetPath(uuid));
71 } 67 }
72 68
73 void SetSourceCompression(CompressionType compression)
74 {
75 sourceCompression_ = compression;
76 }
77
78
79 /** 69 /**
80 * Implementation of the IHttpStreamAnswer interface. 70 * Implementation of the IHttpStreamAnswer interface.
81 **/ 71 **/
82 72
83 virtual HttpCompression SetupHttpCompression(bool /*gzipAllowed*/, 73 virtual uint64_t GetContentLength()
84 bool /*deflateAllowed*/); 74 {
85 75 return size_;
86 virtual uint64_t GetContentLength(); 76 }
87 77
88 virtual bool ReadNextChunk(); 78 virtual bool ReadNextChunk();
89 79
90 virtual const char* GetChunkContent(); 80 virtual const char* GetChunkContent()
81 {
82 return chunk_.c_str();
83 }
91 84
92 virtual size_t GetChunkSize(); 85 virtual size_t GetChunkSize()
86 {
87 return chunkSize_;
88 }
93 }; 89 };
94 } 90 }