[gdal-dev] [mapserver-dev] New env. var. to make it easier to test/debug web services

Even Rouault even.rouault at spatialys.com
Thu Oct 2 12:01:58 PDT 2014


Le jeudi 02 octobre 2014 20:57:46, Lime, Steve D (MNIT) a écrit :
> How about making -nh set the environment variable programatically and
> losing the sendheaders checks?

Yes, that's a possibility. Although I think -nh could just call a function to 
disable the boolean in msio instead of messing with environmenet variables.

But I don't think we can remove all the sendheaders logic completely.  As 
mentionned in my above email, there's seem to have places where you want to 
disable/enable headers temporarily. Seems related to template. But I'm not 
familiar with the part of the code.

> 
> ________________________________________
> From: Even Rouault [even.rouault at spatialys.com]
> Sent: Thursday, October 02, 2014 1:55 PM
> To: Lime, Steve D (MNIT)
> Cc: gdal-dev at lists.osgeo.org
> Subject: Re: [mapserver-dev] New env. var. to make it easier to test/debug 
> web services
> 
> Le jeudi 02 octobre 2014 20:45:26, Lime, Steve D (MNIT) a écrit :
> > You were aware of the -nh option for mapserv, right?
> 
> Steve,
> 
> Ah, good point, actually, I was not.... I should have asked first.  But -nh
> doesn't seem to work. At least not in the WMS or WFS cases. It seems
> mapio.c doesn't honour mapserv->sendheaders, and the WMS or WFS code
> doesn't test it either
> 
> By looking at the places where sendheaders is used, it seems that you must
> test sendheaders at each place where msIO_setHeader() is called. Whereas my
> change does put the test inside msIO_setHeader() itself. Which is less
> error prone I think. But we cannot decently let both mechanisms in place
> 
> I see also some places that directly mess with sendheaders. Not sure why...
> 
> ../maptemplate.c:  mapserv->sendheaders = MS_TRUE;
> ../maptemplate.c:    mapserv->sendheaders = MS_FALSE;
> ../mapwfs.c:    mapserv->sendheaders = MS_TRUE;
> 
> Even
> 
> > ________________________________________
> > From: mapserver-dev-bounces at lists.osgeo.org
> > [mapserver-dev-bounces at lists.osgeo.org] on behalf of Even Rouault
> > [even.rouault at spatialys.com] Sent: Thursday, October 02, 2014 1:44 PM
> > To: mapserver-dev at lists.osgeo.org
> > Subject: [mapserver-dev] New env. var. to make it easier to test/debug
> > web
> > 
> >     services
> > 
> > Hi,
> > 
> > I always get annoyed when running mapserv from command line and wanting
> > to test/debug WMS, WFS, etc... without launching mapserv as a CGI,
> > because the HTTP headers get emitted and thus produce an invalid PNG or
> > GML. So I've pushed in master a small enhancement. If MS_HTTP_HEADER=NO
> > is set as environmenet variable, the HTTP headers are not emitted.
> > 
> > So now you can do things like :
> > 
> > MS_HTTP_HEADER=NO mapserv QUERY_STRING="map=test.map&SERVICE=WMS&..." >
> > out.png && display out.png MS_HTTP_HEADER=NO mapserv
> > QUERY_STRING="map=test.map&SERVICE=WFS&..."  | xmllint -noout -
> > 
> > Even
> > 
> > --
> > Spatialys - Geospatial professional services
> > http://www.spatialys.com
> > _______________________________________________
> > mapserver-dev mailing list
> > mapserver-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-dev
> 
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list