[mapguide-commits] r9689 - sandbox/jng/ogc_viewer_representation/Web/src/DevHttpServer

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jul 28 05:29:53 PDT 2020


Author: jng
Date: 2020-07-28 05:29:52 -0700 (Tue, 28 Jul 2020)
New Revision: 9689

Modified:
   sandbox/jng/ogc_viewer_representation/Web/src/DevHttpServer/main.cpp
Log:
Handle automatic cleanup of temp files

Modified: sandbox/jng/ogc_viewer_representation/Web/src/DevHttpServer/main.cpp
===================================================================
--- sandbox/jng/ogc_viewer_representation/Web/src/DevHttpServer/main.cpp	2020-07-28 12:12:15 UTC (rev 9688)
+++ sandbox/jng/ogc_viewer_representation/Web/src/DevHttpServer/main.cpp	2020-07-28 12:29:52 UTC (rev 9689)
@@ -216,8 +216,14 @@
                     sink->ToFile(fileName);
 
                     param->AddParameter(key, fileName);
-                    //tempfile is a hint to the MgHttpRequest for it to create a MgByteSource from it
-                    param->SetParameterType(key, MapAgentStrings::TempfileKey);
+                    // I don't think the value we pass in actually matters for this parameter, I only
+                    // know that CgiPostParser is doing it so we should follow that behavior. So for now
+                    // this value is just a random string.
+                    param->SetParameterType(key, L"fEvbsA");
+
+                    // indicate this is a temporary file
+                    param->AddParameter(fileName, MapAgentStrings::TempfileKey);
+                    param->SetParameterType(fileName, MapAgentStrings::TempfileKey);
                 }
             }
         }
@@ -339,6 +345,8 @@
     {
         HandleMgHttpError(result, res);
     }
+
+    MapAgentCommon::DeleteTempFiles(param);
     return result->GetStatusCode();
 }
 



More information about the mapguide-commits mailing list