[mapserver-commits] r7612 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu May 22 00:55:30 EDT 2008


Author: sdlime
Date: 2008-05-22 00:55:30 -0400 (Thu, 22 May 2008)
New Revision: 7612

Modified:
   trunk/mapserver/mapserv.c
Log:
Added command line switch to suppress mime headers. (#2594)

Modified: trunk/mapserver/mapserv.c
===================================================================
--- trunk/mapserver/mapserv.c	2008-05-22 04:29:46 UTC (rev 7611)
+++ trunk/mapserver/mapserv.c	2008-05-22 04:55:30 UTC (rev 7612)
@@ -1108,6 +1108,8 @@
   imageObj *img=NULL;
   int status;
 
+  int sendheaders = MS_TRUE;
+
   /* Use MS_ERRORFILE and MS_DEBUGLEVEL env vars if set */
   if( msDebugInitFromEnv() != MS_SUCCESS ) {
     writeError();
@@ -1125,6 +1127,8 @@
       printf("%s\n", msGetVersion());
       fflush(stdout);
       exit(0);
+    } else if( iArg < argc-1 && strcmp(argv[iArg], "-nh") == 0) {
+      sendheaders = MS_FALSE;
     } else if( iArg < argc-1 && strcmp(argv[iArg], "-tmpbase") == 0) {
       msForceTmpFileBase( argv[++iArg] );
     } else if( iArg < argc-1 && strcmp(argv[iArg], "-t") == 0) {
@@ -1174,6 +1178,7 @@
     /*      Process a request.                                              */
     /* -------------------------------------------------------------------- */
     mapserv = msAllocMapServObj();
+    mapserv->sendheaders = sendheaders; /* override the default if necessary (via command line -nh switch) */
 
     mapserv->request->ParamNames = (char **) malloc(MS_MAX_CGI_PARAMS*sizeof(char*));
     mapserv->request->ParamValues = (char **) malloc(MS_MAX_CGI_PARAMS*sizeof(char*));



More information about the mapserver-commits mailing list