<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The hard limit was purposeful. The thought at the time was that
100 would be sufficient in 99.9% of cases (this is the only time I&#8217;ve heard of
someone running into it) and anything beyond 100 would likely be some sort of rogue
attack. The code itself does not use the maximum in allocating parameter lists,
that&#8217;s done dynamically. It&#8217;s only a check&#8230;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Steve <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> mapserver-users-bounces@lists.osgeo.org
[mailto:mapserver-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Jan
Hartmann<br>
<b>Sent:</b> Thursday, September 23, 2010 1:23 AM<br>
<b>To:</b> mapserver-users@lists.osgeo.org; Lime, Steve D (DNR)<br>
<b>Subject:</b> Re: [mapserver-users] RE: CGI returning a 502 error<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Wasn't there a similar problem about the hard-coded maximum
number of classes a few years ago? That problem was solved, if I remember
correctly. Wouldn't it be a good idea to take that solution over to the number
of CGI parms? The problem won't turn up often, but if it does it is hard to
detect, and as far as I can see it's not hard to solve.<br>
<br>
Jan<br>
<br>
On 09/22/10 20:56, Lime, Steve D (DNR) wrote: <o:p></o:p></p>

<pre>Yes, there is a preset limit on the number of parameters the MapServer cgi will accept and indeed it is 100. There are two ways to work around this.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>1) Edit the MS_MAX_CGI_PARAMS setting in cgiutil.h and recompile.<o:p></o:p></pre><pre>2) Consider combining the requested layers calls into a single variable. That is:<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Change <o:p></o:p></pre><pre>&nbsp;&nbsp;...layer=layer1&amp;layer=layer2&amp;layer=layer3... <o:p></o:p></pre><pre>to:<o:p></o:p></pre><pre>&nbsp; ...layers=layer1+layer2+layer3...<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>You should see an error message from MapServer in your web server error log if you ran into this limitation...<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Steve<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: <a
href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [<a
href="mailto:mapserver-users-bounces@lists.osgeo.org">mailto:mapserver-users-bounces@lists.osgeo.org</a>] On Behalf Of stoli<o:p></o:p></pre><pre>Sent: Tuesday, September 21, 2010 11:19 AM<o:p></o:p></pre><pre>To: <a
href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><o:p></o:p></pre><pre>Subject: [mapserver-users] RE: CGI returning a 502 error<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I do not think it is a string length limit. The IIS returns a separate error<o:p></o:p></pre><pre>for that. At least it does when you exceed the URL length limit in a GET<o:p></o:p></pre><pre>request. <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I have been doing some tests and it looks like it might be more of a limit<o:p></o:p></pre><pre>in the number of parameters in the POST request. I can't find any info<o:p></o:p></pre><pre>regarding the maximum number of parameters that you can send in one request<o:p></o:p></pre><pre>(to an IIS server), but again, I would think that IIS would be responding<o:p></o:p></pre><pre>with a more specific error if the limit was with it. <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Is it possible that the MapServer CGI is limited to 100 POST parameters? <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Fawcett, David (MPCA) wrote:<o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre><o:p>&nbsp;</o:p></pre><pre>According to the docs, starting with MapServer 5.0, there is no limit to<o:p></o:p></pre><pre>the number of layers in a mapfile. <o:p></o:p></pre><pre><a
href="http://mapserver.org/introduction.html#layer-object">http://mapserver.org/introduction.html#layer-object</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I am guessing that you are running into a different issue.&nbsp; <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Have you captured the post request string and examined it to make sure<o:p></o:p></pre><pre>that it is valid?&nbsp; <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Are you running into a string length limit for your post request?&nbsp; The URL<o:p></o:p></pre><pre>for your post request would be limited to ~2k char for IE, but this only<o:p></o:p></pre><pre>includes the URL to the server, not the key:value pairs.&nbsp; There could be a<o:p></o:p></pre><pre>size limit for post requests set on your Web server to help prevent DOS<o:p></o:p></pre><pre>attacks.&nbsp; I don't know where this would be set in IIS.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>David.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: <a
href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a><o:p></o:p></pre><pre>[<a
href="mailto:mapserver-users-bounces@lists.osgeo.org">mailto:mapserver-users-bounces@lists.osgeo.org</a>] On Behalf Of stoli<o:p></o:p></pre><pre>Sent: Monday, September 20, 2010 6:18 PM<o:p></o:p></pre><pre>To: <a
href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><o:p></o:p></pre><pre>Subject: [mapserver-users] CGI returning a 502 error<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I'm using the ms4w binaries (5.6.3) under IIS 7.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>My application sends (via http POST) a lot of parameters to modify the<o:p></o:p></pre><pre>.map<o:p></o:p></pre><pre>file. Mostly to add features to layers that are turned off by default and<o:p></o:p></pre><pre>then make them visible. When my parameters cause the map to show over 50<o:p></o:p></pre><pre>layers, the IIS returns a 502 error. <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I realize that the max layers are set to 100 in the default map.h file,<o:p></o:p></pre><pre>but<o:p></o:p></pre><pre>like I said, I am using the compiled binaries from ms4w. Does anyone know<o:p></o:p></pre><pre>if<o:p></o:p></pre><pre>they change that to 50 when they compile, or should I look elsewhere to<o:p></o:p></pre><pre>find<o:p></o:p></pre><pre>my problem? <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-- <o:p></o:p></pre><pre>View this message in context:<o:p></o:p></pre><pre><a
href="http://osgeo-org.1803224.n2.nabble.com/CGI-returning-a-502-error-tp5552675p5552675.html">http://osgeo-org.1803224.n2.nabble.com/CGI-returning-a-502-error-tp5552675p5552675.html</a><o:p></o:p></pre><pre>Sent from the Mapserver - User mailing list archive at Nabble.com.<o:p></o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapserver-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapserver-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre></blockquote>

<pre><o:p>&nbsp;</o:p></pre></div>

</body>

</html>