diff Core/HttpServer/BufferHttpSender.h @ 1525:f9b0169eb6bb

testing
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 11 Aug 2015 17:50:38 +0200
parents c388502a066d
children b1291df2f780
line wrap: on
line diff
--- a/Core/HttpServer/BufferHttpSender.h	Tue Aug 11 16:09:24 2015 +0200
+++ b/Core/HttpServer/BufferHttpSender.h	Tue Aug 11 17:50:38 2015 +0200
@@ -38,13 +38,13 @@
   class BufferHttpSender : public HttpFileSender
   {
   private:
-    std::string buffer_;
-    bool done_;
+    std::string  buffer_;
+    size_t       position_;
+    size_t       chunkSize_;
+    size_t       currentChunkSize_;
 
   public:
-    BufferHttpSender() : done_(false)
-    {
-    }
+    BufferHttpSender();
 
     std::string& GetBuffer() 
     {
@@ -56,18 +56,18 @@
       return buffer_;
     }
 
+    // This is for test purpose. If "chunkSize" is set to "0" (the
+    // default), the entire buffer is consumed at once.
+    void SetChunkSize(size_t chunkSize)
+    {
+      chunkSize_ = chunkSize;
+    }
+
 
     /**
      * Implementation of the IHttpStreamAnswer interface.
      **/
 
-    virtual HttpCompression SetupHttpCompression(bool /*gzipAllowed*/, 
-                                                 bool /*deflateAllowed*/)
-    {
-      // No compression is supported
-      return HttpCompression_None;
-    }
-
     virtual uint64_t GetContentLength()
     {
       return buffer_.size();