[mapguide-commits] r7272 - sandbox/jng/streaming/Web/src/ApacheAgent

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Dec 16 18:59:42 PST 2012


Author: jng
Date: 2012-12-16 18:59:41 -0800 (Sun, 16 Dec 2012)
New Revision: 7272

Added:
   sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.cpp
   sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.h
Log:
#2199: Missed these two important files

Added: sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.cpp
===================================================================
--- sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.cpp	                        (rev 0)
+++ sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.cpp	2012-12-17 02:59:41 UTC (rev 7272)
@@ -0,0 +1,22 @@
+#include "ApacheReaderStreamer.h"
+#include "http_protocol.h"
+
+ApacheReaderStreamer::ApacheReaderStreamer(request_rec* rec, MgReader* reader, CREFSTRING format) :
+    MgHttpReaderStreamer(reader, format), m_r(rec)
+{
+}
+
+ApacheReaderStreamer::~ApacheReaderStreamer() { }
+
+void ApacheReaderStreamer::SetChunkedEncoding() 
+{
+    //Setting chunked to 1 enables chunked transfer encoding. No need to manually
+    //write out chunk delimiters and fragments
+    m_r->chunked = 1; 
+}
+
+void ApacheReaderStreamer::WriteChunk(const char* str, size_t length)
+{
+    //Each ap_rwrite call is considered an individual chunk when m_r->chunked is set to 1
+    ap_rwrite(str, length, m_r);
+}
\ No newline at end of file

Added: sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.h
===================================================================
--- sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.h	                        (rev 0)
+++ sandbox/jng/streaming/Web/src/ApacheAgent/ApacheReaderStreamer.h	2012-12-17 02:59:41 UTC (rev 7272)
@@ -0,0 +1,38 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#ifndef APACHE_READER_STREAMER_H
+#define APACHE_READER_STREAMER_H
+
+#include "MapGuideCommon.h"
+#include "httpd.h"
+#include "HttpHandler.h"
+
+class ApacheReaderStreamer : public MgHttpReaderStreamer
+{
+public:
+    ApacheReaderStreamer(request_rec* rec, MgReader* reader, CREFSTRING format);
+    virtual ~ApacheReaderStreamer();
+
+protected:
+    virtual void SetChunkedEncoding();
+    virtual void WriteChunk(const char* str, size_t length);
+
+private:
+    request_rec* m_r;
+};
+
+#endif
\ No newline at end of file



More information about the mapguide-commits mailing list