/*****************************************************************************/
#ifdef COMMENTS_WITH_COMMENTS
/*
                                MapSet.c

The SET rule allows characteristics to be set against a particular path.  They
are then transfered to any request matching the path and applied to the
request.  This applies to FILES, not necessarily to scripts that supply a full
HTTP response.  These need to check and act on information provided by relevant
CGI variables.  Note that as of V8.0 path SETings can be applied with any rule
that has a result string (i.e. the setting must follow both a template and a
result and preceded any conditional).

[NO]ACCEPT=LANG=([DEFAULT=<language>][,CHAR=<char>][,VARIANT=NAME|TYPE])
                path will attempt to resolve a language-specific document,
                with default language (optional), 'char' is a character
                (optional) separating language from file type (default '_'),
                if the path template has a file type wildcard included the
                file content-type does not need to be "text/.."

ACCESS=[NO]SERVER    access as server account (best effort) 
ACCESS=[NO]PROFILE   access according to SYSUAF profile
ACCESS=[NO]READ      allowed to read this path
ACCESS=[NO]WRITE     allowed to write to this path (implied read)

[NO]ALERT         indicate that a request with this path has been detected,
                  HTTPDMON and OPCOM alert, and the process log gets a record
ALERT=MAP         alert provided immediately after mapping,
ALERT=AUTH        or immediately after authorization,
ALERT=END         or provided at request rundown (the default)
ALERT=<integer>   the integer can be a specific HTTP status value (e.g. 501)
                  or the category (range of values, e.g. 599) alert if match

[NO]AUTH=ALL      all access must be subject to authorization (or fail)
[NO]AUTH=ONCE     authorize only the script portion of the request,
                  do not repeat authorization on any path component
[NO]AUTH=MAPPED   authorize against the mapped path

AUTH=REVALIDATE=<hh:mm:ss>  revalidate authentication for this path
                            at the specified interval

AUTH=SYSUAF=PWDEXPURL=<string>  redirection URL if s SYSUAF-authenticated
                                user's primary password has expired

[NO]CACHE              cache files (not any other output)
CACHE=NONE             do not cache
CACHE=[NO]CGI          cache CGI-compliant script output
CACHE=[NO]COOKIE       cache including requests with cookies
CACHE=EXPIRES=0        cancels path cache entry expiry
CACHE=EXPIRES=DAY      entry expires on change of day
CACHE=EXPIRES=HOUR     entry expires on change of hour
CACHE=EXPIRES=MINUTE   entry expires on change of minute
CACHE=EXPIRES=<hh:mm:ss>  specify the exact period before expiry
CACHE=[NO]FILE         cache files
CACHE=GUARD=<hh:mm:ss> prevent (Pragma:) reloads during these seconds
CACHE=MAX=<integer>    up to kBytes in size (overrides [CacheFileKBytesMax])
CACHE=[NO]NET          cache response network output of any kind
CACHE=[NO]NPH          cache NPH-compliant script output
CACHE=[NO]PERMANENT    cache this, do not allow it to be flushed
CACHE=[NO]QUERY        cache including requests with query strings
CACHE=[NO]SCRIPT       synonym for (both) 'cache=cgi cache=nph'
CACHE=[NO]SSI          cache Server-Side Includes output

CGIPLUSIN=CC=NONE   set explicit carriage-control to be added to each
CGIPLUSIN=CC=LF     CGIPLUSIN record (esoteric? a bit; ask Alex Ivanov :^)
CGIPLUSIN=CC=CR
CGIPLUSIN=CC=CRLF

CGIPLUSIN=EOF       terminate each request's CGIPLUSIN stream with an EOF
                    (same comment as immediately above)

CGI=PREFIX=<string>  instead of the default "WWW_" specify what is needed,
                     to have no prefix at all specify CGI=PREFIX=

CGI=VAR=<string>     (re)set a CGI variable (<name>=<value>)

CHARSET=<string>  any "text/..." content-type files use the specified charset

CLIENT=FORWARDED         replace client IP address with Forwarded: header
CLIENT=IF=FORWARDED      replace client IP address IF a Forwarded: header
CLIENT=LITERAL=<string>  really just for ease of testing
CLIENT=RESET             revert to original (upstream) client data
CLIENT=XFORWARDEDFOR     replace IP address with X-Forwarded-for: header
CLIENT=IF=XFORWARDEDFOR  replace IP address IF an X-Forwarded-for: header

CORS=AGE=       Access-Control-Max-Age: response header
CORS=CRED=      Access-Control-Allow-Credentials: response header
CORS=EXPOSE=    Access-Control-Expose-Headers: response header
CORS=HEADERS=   Access-Control-Allow-Headers: response header
CORS=METHODS=   Access-Control-Allow-Methods: response header
CORS=ORIGIN=    Access-Control-Allow-Origin: response header

CONTENT=        all files have the "Content-Type:" forced to that specified
                (obvious use is to provide plain-text or binary versions of
                files using perhaps "set /plain-text/* content=text/plain",
                then mapping that generally back with "map /plain-text/* /*")
                another: "set /bogus/* "content=text/html; charset=BLAH"

CSS=<url>       style sheet to load to customise server-generated pages

DICT=[!][<key>[=<value]] manipulate the meta dictionary

DIR=ACCESS            directory listing enabled  (same as [DirAccess])
DIR=ACCESS=SELECTIVE  allowed if directory contains .WWW_BROWSABLE
DIR=NOACCESS          directory listing disabled

DIR=CHARSET=<string>  directory listing page is given this charset
                      (this could be called the Alex Ivanov rule ;^)

DIR=DELIMIT[=BOTH]    both top and bottom rule and any readme
DIR=DELIMIT=HEADER    only top rule and any readme
DIR=DELIMIT=FOOTER    only bottom rule and any readme
DIR=DELIMIT=NONE      no top or bottom rule or readme

DIR=FONT=INHERIT      listing font inherited from browser or document
DIR=FONT=MONOSPACE    listing font monospace (default)

DIR=ILINK       icon plain-text link (default)
DIR=NOILINK     no icon plain-text link

DIR=IMPLIEDWILDCARD    implied wildcard enabled
DIR=NOIMPLIEDWILDCARD  implied wildcard disabled

DIR=LAYOUT=     same as index=<string>

DIR=SORT=<char>[+|-]   pre-sort directory listing

DIR=STYLE[=DEFAULT]    current (post-10.4) style
DIR=STYLE=ORIGINAL[2]  pre-v8.2 WASD style
DIR=STYLE=ANCHOR[2]    post-v8.2 WASD style
DIR=STYLE=HTDIR[2]     Alex Ivanov's listing style
DIR=STYLE=SORT[2]      HTML table and sortable
DIR=STYLE=TABLE[2]     post-v10.4 WASD style (current, default)

DIR=TARGET=<string>            open a file in this window (e.g. "_blank")

DIR=TITLE=<integer>    directory name (0 = none, 1 = top, 2, 3..99 = bottom)
DIR=TITLE=DEFAULT      whatever the default is for the style
DIR=TITLE=OWNER        the VMS owner
DIR=TITLE=REMOTE       if authorised access just the remote user name
DIR=TITLE=THIS=".."    literal string

DIR=THESE=<string>[,<string>]  one of more wildcard file name selectors

DIR=VERSIONS=<integer>|*       display a maximum of this many file versions

DIR=WILDCARD    wildcard-forced listing enabled   (same as [DirWildcard])
DIR=NOWILDCARD  wildcard-forced listing disabled

[NO]EXPIRED     files in the path are sent "pre-expired"

NOHTML            cancel any/all previously set html=
HTML=BODYTAG=     HTML <body..> tag
HTML=HEADER=      HTML page header text (can include markup)
HTML=HEADERTAG=   HTML header tag <td..> (usually colour)
HTML=FOOTER=      HTML page footer text (can include markup)
HTML=FOOTERTAG=   HTML footer tag <td..> (usually colour)

HTTP=ACCEPT-CHARSET=<string>   explicitly set the request's accepted charset
HTTP=ACCEPT-LANGUAGE=<string>  explicitly set the request's accepted language

HTTP2=PROTOCOL=1.1              downgrade HTTP/2 to HTTP/1.1 (immediately)
HTTP2=SEND=GOAWAY[=<integer>]   send GOAWAY frame with optional error code
HTTP2=SEND=PING                 send PING frame
HTTP2=SEND=RESET[=<integer>]    send RST_STREAM frame with optional error code
HTTP2=STREAMS=MAX=<integer>     per-path maximum concurrent streams
HTTP2=WRITE=[low|normal|high]   set response write priority

INDEX=<string>  "Index of" format string (same as "?httpd=index&...")

[NO]LOG         requests to this path are not to be access-logged

MAP=[NO]AFTER      (re)map after authorization
MAP=[NO]ELLIPSIS   allows mapping of the VMS '...' ellipsis wildcard that
                   provides for tree traversal
MAP=[NO]EMPTY      traditionally a path must have contained at least one char
                   to be mapped, this allows "empty" paths to be mapped
MAP=[NO]METHOD     set the path to process an HTTP (/1.1) extension-method
                   e.g. 'if (request-method:QUARK) \
                            script /quark* /cgi-bin/quark* map=method'
MAP=[NO]ONCE       normally, when a script has been derived from a path, WASD
                   goes on to map the 'path' portion in a separate pass - this
                   SETing provides the derived path as-is
MAP=RESTART        begin again at rule number one (limit on this action)
MAP=ROOT=<string>  prefix all result paths with this string (path)
MAP=SET=[NO]REQUEST  path SETings affect the request (or only the mapping)
MAP=SET=[NO]IGNORE   all path SETings are ignored (except 'map=set=noignore')
MAP=URI            begin to process against raw request URI (path plus query)

NOOP               do nothing :-]

NOTEPAD=[+]<string>  text (perhaps keywords) added to a request during mapping
                     that can be detected during subsequent metacon, mapping
                     and authorization rule processing (not externally visible)
                     NOTEPAD PERSISTS ACROSS INTERNALLY REDIRECTED REQUESTS!
                     
ODS=2             path marked as ODS-2 (path default)
ODS=5             path marked as ODS-5, with EFS encoded file names
ODS=ADS           path marked as having filenames Advanced Server (6) encoded
ODS=PWK           path marked as having filenames PATHWORKS (4 & 5) encoded
ODS=SMB           same as ODS=ADS (only for the comfort of Samba users)
ODS=SRI           path marked as having filenames SRI (MultiNet NFS) encoded
NOODS             reset the path's ODS file naming
ODS=NAME=8BIT     file name uses native ODS 8 bit encoding (default)
ODS=NAME=UTF8     file name uses explicit UTF-8 encoding
ODS=NAME=DEFAULT  return naming to the default encoding

[NO]PROFILE     VMS SYSUAF-authenticated security profile applies/does not
                apply to this path

PROXY=[NO]AFFINITY             enable/disable affinity

PROXY=NOFORWARDED              disable the "Forwarded: by" field
PROXY=FORWARDED[=BY]           enable the field with "by" data
PROXY=FORWARDED=FOR            enable the field with "by" and "for" data
PROXY=FORWARDED=ADDRESS        enable the field with "by" and "for" address

PROXY=NOXFORWARDEDFOR          disable "X-Forwarded-For:" field
PROXY=XFORWARDEDFOR[=ENABLED]  add client host, propagate any existing
PROXY=XFORWARDEDFOR=ADDRESS    add client address, propagate any existing
PROXY=XFORWARDEDFOR=UNKNOWN    hide this host, propagate any existing

PROXY=BIND=<string>    bind the outgoing proxy socket to this IP address
PROXY=CHAIN=<string>   chain to this proxy server
PROXY=CHAIN=CRED=<string>   <username>:<password> credentials for chain

PROXY=HEADER=<name>[=<string>]  remove or modify this request header

PROXY=REVERSE=[NO]AUTH  suppress propagation of any "Authorize:" header
PROXY=REVERSE=LOCATION  rewrite a reverse proxy 302 "Location:" response to
                        contain the proxy server (can ONLY be used following
                        a 'redirect /foo/* /http://foo.bar/*' rule)
PROXY=REVERSE=[NO]VERIFY   for a locally authorized, reverse proxied request
                           create a verifyable authorization header containing
                           the username and a unique identifier for 'callback'
PROXY=REWORK=<string>   replacement strings when reworking proxy response

PROXY=TUNNEL=REQUEST=<string>  make this the tunnelled request

PUT=MAX=<integer>          maximum Kbytes allowed to be PUT/POSTed
                           is '*' is used instead it means no limit
PUT=RFM=[FIX512|STM|STMCR|STMLF|UDF] set the record format for binary PUT/POSTs

QUERY-STRING=<string>  set the request's query-string (URL-encode if necessary)

REGEX=<keyword>  AWK, DEFAULT, ED, EGREP, GREP, POSIX_AWK, POSIX_BASIC,
                 POSIX_EGREP, POSIX_EXTENDED, POSIX_MINIMAL_BASIC,
                 POSIX_MINIMAL_EXTENDED, SED, WASD

REPORT=400=<integer>   bad request reported as (e.g. "report=400=403")
REPORT=403=<integer>   forbidden reported as (e.g. "report=403=404")
REPORT=404=<integer>   not found reported as (e.g. "report=404=403")
REPORT=BASIC     supply basic error information for requests on this path
REPORT=DETAILED  supply detailed error information for requests on this path
REPORT=TUNNEL    supply error message suitable for firewall/raw tunnel

RESPONSE=200=203       modify a 200 response to 203 for log analysis
RESPONSE=203=200       undoes the above

RESPONSE=[NO]CSP=<string>    add Content Security Policy to response header
RESPONSE=[NO]CSPRO=<string>  add CSP Report Only to response header

RESPONSE=HEADER=ADD=<string>  append this header field to the response header
RESPONSE=HEADER=NOADD         cancel (potentially) additional header fields
RESPONSE=HEADER=FULL   revert to normal response header transmission
RESPONSE=HEADER=NONE   suppress response header transmission (i.e. the file 
                       or content contains *full* HTTP response - NPH-like!)
RESPONSE=HEADER=BEGIN  suppress the end-of-header blank line so that the file
                       or other content can provide additional header lines

RESPONSE=GZIP=ALL         compress all responses (those possible anyway)
RESPONSE=GZIP=<integer>   compress responses known to be larger than kBytes
RESPONSE=GZIP=NONE        do not compress any responses

RESPONSE=HTTP=ORIGINAL    respond with HTTP/1.0 if request was that version

RESPONSE=[NO]CHUNKED      return applicable responses chunked

RESPONSE=STS=<value>      Strict-Transport-Security: header

RESPONSE=VAR              reset variable length record to default (<LF>)
RESPONSE=VAR=ASIS         transfer file content EXACTLY as it is on disk
                          resulting in a binary image of the file downloaded
RESPONSE=VAR=CRLF         variable length record file append <CR><LF>
RESPONSE=VAR=LF                                       append <LF> (default)
RESPONSE=VAR=NONE                                     append nothing

RMSCHAR=<char>  provides the RMS-invalid substitution character, which unless
                otherwise specified is the dollar symbol. Any general
                RMS-valid character may be specified (e.g. alpha-numeric,
                '$', '-' or '_', although the latter three are probably the
                only REAL choices).  When an RMS-invalid character (e.g. '+')
                or syntax (e.g. multiple periods) is encountered this character
                is substituted.  NOTE: is not applied to ODS-5 volumes.

SCRIPT=AS=<user>  the script process will be using this username/account
                  (only applies if detached script processes are enabled)
SCRIPT=BIT-BUCKET=<hh:mm:ss>  per-path equivalent to config file setting
SCRIPT=BODY=[NO]DECODE    decode any chunked or gzip encoded request body
                          before delivering the content to the script
SCRIPT=COMMAND=<string>   provide the script activation command-line with
                          qualifiers, parameters, etc. (first character must
                          be an asterisk or it overrides the full verb)
SCRIPT=CONTROL=<string>   equivalent of "Script-Control:" in CGI response
SCRIPT=CPU=<hh:mm:ss>  CPU limit for each *script's* processing
                       (not a per-process limit like CPULM would be)
SCRIPT=DEFAULT=<string>   default directory script process should be set to
                          before activation ('#" disables this, can be a U**x
                          style spec beginning '/' in which case it's ignored)
SCRIPT=LIFETIME=<hh:mm:ss>  CGI or CGIplus lifetime for quiescent processes
                            (per-path equivalent of [DclZombieLifetime] and
                             DclCGIplusLifeTime] global directives)
SCRIPT=SYMBOLS=[NO]TRUNCATE  truncate CGI symbols that would otherwise exceed
                             the maxima of this VMS versions CLI
SCRIPT=SYNTAX=[NO]UNIX    script file name and path translated is passed in
                          U**x syntax
SCRIPT=FIND     (default) search for the script file in any 'script' or 'exec'
SCRIPT=NOFIND   do not search for the script file (for use with RTEs)
SCRIPT=PARAMS=[+](name=value)  a list of additional (non-CGI) variables
                               assigned and passed to a script
[NO]SCRIPT=PATH=FIND      check that the PATH_TRANSLATED exists and before
                          invoking the script report 404 if it doesn't
[NO]SCRIPT=QUERY=NONE     do not parse query string into form or key elements
[NO]SCRIPT=QUERY=RELAXED  don't error report form-url-encoding issues,
                          let the script deal with it if necessary

[NO]SEARCH=NONE           do not activate (any) default search script

SERVICE=<string>          move request to this service (when mapping finished)

SSI=PRIV        mark a path as allowed to contain SSI documents that can
SSI=NOPRIV      use privileged SSI statements (e.g. "#dcl")
SSI=<string>    where string is a list of "#dcl" parameters allowed
                (this is a finer-grained control that SSI=[NO]PRIV)

SSLCGI=NONE     sets the style of SSL-related CGI variables 
SSLCGI=APACHE_MOD_SSL
SSLCGI=APACHE_MOD_SSL_CLIENT
SSLCGI=APACHE_MOD_SSL_EXTENS
SSLCGI=APACHE_MOD_SSL_OID
SSLCGI=PURVEYOR
[NO]SSLCGI

[NO]STMLF       files in this path can be converted from variable to stream-LF

THROTTLE=FROM=             n1, requests after which queuing occurs
THROTTLE=TO=               n2, requests after which the queue is FIFOed
THROTTLE=RESUME=           n3, requests after which FIFOing stops
THROTTLE=BUSY=             n4, requests after which an immediate 503 "busy"
THROTTLE=NONE              resets previously mapped throttle
THROTTLE=TIMEOUT=QUEUE=    t/o1, hh:mm:ss before a queued request processes
THROTTLE=TIMEOUT=BUSY=     t/o2, hh:mm:ss before a queued request terminates
THROTTLE=USER=             u1, per-user throttling
THROTTLE=n1[/u1][,n2,n3,n4,t/o1,t/o2]
                           n1 = 'from',
                           u1 = 'per-user',
                           n2 = 'to',
                           n3 = 'resume',
                           n4 = 'busy',
                           t/o1 = 'timeout-queue',
                           t/o2 = 'timeout-busy'

TIMEOUT=PERSISTENT=  hh:mm:ss  ("none" to disable, formerly 'KEEPALIVE=')
TIMEOUT=NOPROGRESS=  hh:mm:ss
TIMEOUT=OUTPUT=      hh:mm:ss
TIMEOUT=n,n,n        hh:mm:ss; persistent, noprogress, output
NOTIMEOUT            sets all three (n,n,n) timeouts to infinite (none)

WEBDAV=[NO]ALL       process all requests as WebDAV
WEBDAV=[NO]AUTH      determine authorisation access using WebDAV SETings
WEBDAV=[NO]HIDDEN    display (default), do not display, hidden file names
WEBDAV=[NO]LOCK      allow/apply WebDAV locking to this path
WEBDAV=META=DIR=     string (subdirectory spec or full directory spec)
WEBDAV=[NO]PROFILE   WebDAV access according to SYSUAF profile
WEBDAV=[NO]PROP      allow/apply WebDAV 'dead' property(ies) to this path
WEBDAV=[NO]PUT=LOCK  a resource must be locked before a PUT is allowed
WEBDAV=[NO]READ      WebDAV methods allowed read this tree
WEBDAV=[NO]SERVER    WebDAV access as server account (best effort) 
WEBDAV=[NO]WINPROP   when NOWINPROP windows properties are ignored and emulated
WEBDAV=[NO]WRITE     WebDAV methods allowed write to this path (implied read)
WEBDAV=LOCK=TIMEOUT=DEFAULT=      hh:mm:ss
WEBDAV=LOCK=TIMEOUT=MAX=          hh:mm:ss

WEBSOCKET=INPUT=<integer>   size of WEBSOCKET_INPUT mailbox
WEBSOCKET=OUTPUT=<integer>  size of WEBSOCKET_OUTPUT mailbox


VERSION HISTORY
---------------
27-MAY-2021  MGD  (finally) carved off from MAPURL.C into a module of its own
*/
#endif /* COMMENTS_WITH_COMMENTS */
/*****************************************************************************/

#ifdef WASD_VMS_V7
#undef _VMS__V6__SOURCE
#define _VMS__V6__SOURCE
#undef __VMS_VER
#undef __VMS_VER
#undef __CRTL_VER
#define __CRTL_VER 70000000
#endif

/* standard C header files */
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>

/* VMS related header files */
#include <ssdef.h>
#include <stsdef.h>

#include "wasd.h"

#define WASD_MODULE "MAPSET"

/* fundamental buffer size */
#ifdef __ALPHA
#define MAP_BUFFER_SIZE (8192 * 2)
#else
/* IA64 and whatever else may follow */
#define MAP_BUFFER_SIZE (8192 * 4)
#endif

/******************/
/* global storage */
/******************/

BOOL  MapUrlPathOds5;

/********************/
/* external storage */
/********************/

extern char  ErrorSanityCheck[];

extern WATCH_STRUCT  Watch;

/*****************************************************************************/
/*
The path has a setting.  Map that onto the request path settings.
Return false if a problem, true if the SETing is OK.
*/ 
 
BOOL MapSetConfig
(
char *SetPathPtr,
char *TemplatePtr,
META_CONFIG *mcptr,
MAP_SET_META *mrpsptr,
BOOL *AllowedPtr
)
{
   static char  ProblemAcceptLang [] =
                   "Set path \'accept=lang\' parameter problem",
                ProblemProxyHeader [] = "Proxy header exceeded maximum",
                ProblemSetPath [] = "Set path problem";

   char  *cptr, *sptr;

   /*********/
   /* begin */
   /*********/

   if (WATCH_MODULE(WATCH_MOD_MAPURL))
      WatchThis (WATCHALL, WATCH_MOD_MAPURL, "MapSetConfig()");

   if (strsame (SetPathPtr, "ACCEPT=LANG", -1))
      mrpsptr->AcceptLangChar = '_';
   else
   if (strsame (SetPathPtr, "NOACCEPT=LANG", -1) ||
       strsame (SetPathPtr, "ACCEPT=NOLANG", -1))
      mrpsptr->NoAcceptLang = true;
   else
   if (strsame (SetPathPtr, "ACCEPT=LANG=", 12))
   {
      mrpsptr->AcceptLangChar = '_';
      sptr = SetPathPtr + 12;
      if (*sptr == '(') sptr++;
      while (*sptr)
      {
         if (strsame (sptr, "CHAR=", 5))
         {
            mrpsptr->AcceptLangChar = sptr[5];
            sptr += 6;
         }
         else
         if (strsame (sptr, "DEFAULT=", 8))
         {
            sptr += 8;
            mrpsptr->AcceptLangPtr = sptr;
            while (*sptr && *sptr != ',' && *sptr != ')') sptr++;
            if (*sptr) *sptr++ = '\0';
            mrpsptr->AcceptLangLength = strlen(mrpsptr->AcceptLangPtr);
         }
         else
         if (strsame (sptr, "VARIANT=", 8))
         {
            sptr += 8;
            if (strsame (sptr, "NAME", 4))
               mrpsptr->AcceptLangTypeVariant = false;
            else
            if (strsame (sptr, "TYPE", 4))
               mrpsptr->AcceptLangTypeVariant = true;
            else
            {
               MetaConReport (mcptr, METACON_REPORT_ERROR,
                              ProblemAcceptLang);
               return (false);
            }
            while (*sptr && *sptr != ',' && *sptr != ')') sptr++;
         }
         else
         {
            MetaConReport (mcptr, METACON_REPORT_ERROR,
                           ProblemAcceptLang);
            return (false);
         }
         if (*sptr == ',' || *sptr == ')') sptr++;
      }
      if (mrpsptr->AcceptLangChar != '_' &&
          mrpsptr->AcceptLangChar != '-' &&
          mrpsptr->AcceptLangChar != '.' &&
          mrpsptr->AcceptLangChar != '$')
      {
         MetaConReport (mcptr, METACON_REPORT_ERROR, ProblemAcceptLang);
         return (false);
      }
      /* check if there is a wildcard file type */
      for (sptr = TemplatePtr; *sptr; sptr++);
      while (sptr > TemplatePtr && *sptr != '.' && *sptr != '/') sptr--;
      if (*sptr == '.') mrpsptr->AcceptLangWildcard = true;
   }
   else
   if (strsame (SetPathPtr, "ALERT", -1))
      mrpsptr->Alert = MAPURL_PATH_ALERT_END;
   else
   if (strsame (SetPathPtr, "ALERT=END", -1))
      mrpsptr->Alert = MAPURL_PATH_ALERT_END;
   else
   if (strsame (SetPathPtr, "ALERT=AUTH", -1))
      mrpsptr->Alert = MAPURL_PATH_ALERT_AUTH;
   else
   if (strsame (SetPathPtr, "ALERT=MAP", -1))
      mrpsptr->Alert = MAPURL_PATH_ALERT_MAP;
   else
   if (strsame (SetPathPtr, "ALERT=", 6) &&
       isdigit(SetPathPtr[6]))
   {
      mrpsptr->Alert = atoi(SetPathPtr+6);
      if (!mrpsptr->Alert) mrpsptr->NoAlert = true;
   }
   else
   if (strsame (SetPathPtr, "NOALERT", -1))
      mrpsptr->NoAlert = true;
   else
   if (strsame (SetPathPtr, "AUTH=ALL", -1))
      mrpsptr->AuthAll = true;
   else
   if (strsame (SetPathPtr, "NOAUTH=ALL", -1))
      mrpsptr->NoAuthAll = true;
   else
   if (strsame (SetPathPtr, "AUTH=MAPPED", -1))
      mrpsptr->AuthMapped = true;
   else
   if (strsame (SetPathPtr, "NOAUTH=MAPPED", -1) ||
       strsame (SetPathPtr, "AUTH=REQUEST", -1))
      mrpsptr->NoAuthMapped = true;
   else
   if (strsame (SetPathPtr, "AUTH=ONCE", -1) ||
       strsame (SetPathPtr, "AUTHONCE", -1))
      mrpsptr->AuthOnce = true;
   else
   if (strsame (SetPathPtr, "AUTH=NOONCE", -1) ||
       strsame (SetPathPtr, "NOAUTH=ONCE", -1) ||
       strsame (SetPathPtr, "NOAUTHONCE", -1))
      mrpsptr->NoAuthOnce = true;
   else
   if (strsame (SetPathPtr, "AUTH=REVALIDATE=", 16))
      mrpsptr->AuthRevalidateTimeout =
         MetaConSetSeconds (mcptr, SetPathPtr+16, 60);
   else
   if (strsame (SetPathPtr, "AUTH=SYSUAF=PWDEXPURL=", 22))
   {
      mrpsptr->AuthSysUafPwdExpUrlPtr = SetPathPtr + 22;
      mrpsptr->AuthSysUafPwdExpUrlLength =
         strlen(mrpsptr->AuthSysUafPwdExpUrlPtr);
   }
   else
   if (strsame (SetPathPtr, "CACHE", -1))
      mrpsptr->CacheSetting = mrpsptr->Cache = true;
   else
   if (strsame (SetPathPtr, "NOCACHE", -1) ||
       strsame (SetPathPtr, "CACHE=NONE", -1))
      mrpsptr->CacheSetting = mrpsptr->NoCache = true;
   else
   if (strsame (SetPathPtr, "CACHE=CGI", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheCGI = true;
   else
   if (strsame (SetPathPtr, "CACHE=NOCGI", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoCGI = true;
   else
   if (strsame (SetPathPtr, "CACHE=COOKIE", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheCookie = true;
   else
   if (strsame (SetPathPtr, "CACHE=NOCOOKIE", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoCookie = true;
   else
   if (strsame (SetPathPtr, "CACHE=FILE", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheFile = true;
   else
   if (strsame (SetPathPtr, "CACHE=NOFILE", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoFile = true;
   else
   if (strsame (SetPathPtr, "CACHE=NET", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNet = true;
   else
   if (strsame (SetPathPtr, "CACHE=NONET", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoNet = true;
   else
   if (strsame (SetPathPtr, "CACHE=NPH", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNPH = true;
   else
   if (strsame (SetPathPtr, "CACHE=NONPH", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoNPH = true;
   else
   if (strsame (SetPathPtr, "CACHE=PERM", 10))
      mrpsptr->CacheSetting = mrpsptr->CachePermanent = true;
   else
   if (strsame (SetPathPtr, "CACHE=NOPERM", 12))
      mrpsptr->CacheSetting = mrpsptr->CacheNoPermanent = true;
   else
   if (strsame (SetPathPtr, "CACHE=QUERY", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheQuery = true;
   else
   if (strsame (SetPathPtr, "CACHE=NOQUERY", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoQuery = true;
   else
   if (strsame (SetPathPtr, "CACHE=SCRIPT", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheScript = true;
   else
   if (strsame (SetPathPtr, "CACHE=NOSCRIPT", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoScript = true;
   else
   if (strsame (SetPathPtr, "CACHE=SSI", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheSSI = true;
   else
   if (strsame (SetPathPtr, "CACHE=NOSSI", -1))
      mrpsptr->CacheSetting = mrpsptr->CacheNoSSI = true;
   else
   if (strsame (SetPathPtr, "CACHE=EXPIRES=", 14))
   {
      sptr = SetPathPtr + 14;
      if (strsame (sptr, "DAY", -1))
         mrpsptr->CacheExpiresAfter = CACHE_EXPIRES_DAY;
      else
      if (strsame (sptr, "HOUR", -1))
         mrpsptr->CacheExpiresAfter = CACHE_EXPIRES_HOUR;
      else
      if (strsame (sptr, "MINUTE", -1))
         mrpsptr->CacheExpiresAfter = CACHE_EXPIRES_MINUTE;
      else
      if (strsame (sptr, "0", -1))
         mrpsptr->CacheExpiresAfter = CACHE_EXPIRES_NONE;
      else
         mrpsptr->CacheExpiresAfter =
            MetaConSetSeconds (mcptr, sptr, 1);
      mrpsptr->CacheSetting = true;
   }
   else
   if (strsame (SetPathPtr, "CACHE=GUARD=", 12))
   {
      sptr = SetPathPtr + 12;
      mrpsptr->CacheGuardSeconds = MetaConSetSeconds (mcptr, sptr, 1);
      /* negative 1 indicates to revert to configuration maximum */
      if (!mrpsptr->CacheGuardSeconds) mrpsptr->CacheGuardSeconds = -1;
      mrpsptr->CacheSetting = true;
   }
   else
   if (strsame (SetPathPtr, "CACHE=MAX=", 10))
   {
      sptr = SetPathPtr + 10;
      mrpsptr->CacheMaxKBytes = atoi(sptr);
      while (isdigit(*sptr)) sptr++;
      if (strsame (sptr, "MB", 2))
         mrpsptr->CacheMaxKBytes = mrpsptr->CacheMaxKBytes << 10;
      /* negative 1 indicates to revert to configuration maximum */
      if (!mrpsptr->CacheMaxKBytes) mrpsptr->CacheMaxKBytes = -1;
      mrpsptr->CacheSetting = true;
   }
   else
   if (strsame (SetPathPtr, "CGI=PREFIX=", 11) ||
       strsame (SetPathPtr, "CGIPREFIX=", 10))
   {
      mrpsptr->CgiPrefixPtr = SetPathPtr + 10;
      if (*mrpsptr->CgiPrefixPtr == '=') mrpsptr->CgiPrefixPtr++;
      mrpsptr->CgiPrefixLength = strlen(mrpsptr->CgiPrefixPtr);
   }
   else
   if (strsame (SetPathPtr, "CGIPLUSIN=EOF", -1))
      mrpsptr->CgiPlusInWriteof = true;
   else
   if (strsame (SetPathPtr, "CGIPLUSIN=NOEOF", -1) ||
       strsame (SetPathPtr, "NOCGIPLUSIN=EOF", -1))
      mrpsptr->CgiPlusInNoWriteof = true;
   else
   if (strsame (SetPathPtr, "CGIPLUSIN=CC=NONE", -1))
      memcpy (mrpsptr->CgiPlusInCC, "\0**", 4);
   else
   if (strsame (SetPathPtr, "CGIPLUSIN=CC=LF", -1))
      memcpy (mrpsptr->CgiPlusInCC, "\n\0*", 4);
   else
   if (strsame (SetPathPtr, "CGIPLUSIN=CC=CR", -1))
      memcpy (mrpsptr->CgiPlusInCC, "\r\0*", 4);
   else
   if (strsame (SetPathPtr, "CGIPLUSIN=CC=CRLF", -1))
      memcpy (mrpsptr->CgiPlusInCC, "\r\n\0", 4);
   else
   if (strsame (SetPathPtr, "CGI=VAR=", 8))
   {
      mrpsptr->CgiVarPtr = SetPathPtr + 8;
      mrpsptr->CgiVarLength = strlen(mrpsptr->CgiVarPtr);
   }
   else
   if (strsame (SetPathPtr, "CHARSET=", 8))
   {
      mrpsptr->CharsetPtr = SetPathPtr + 8;
      mrpsptr->CharsetLength = strlen(mrpsptr->CharsetPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "CLIENT=FORWARDED", -1))
      mrpsptr->ClientAddress = MAPURL_CLIENT_FORWARDED;
   else
   if (strsame (SetPathPtr, "CLIENT=IF=FORWARDED", -1))
      mrpsptr->ClientAddress = MAPURL_CLIENT_IF_FORWARDED;
   else
   if (strsame (SetPathPtr, "CLIENT=LITERAL=", 15))
   {
      /* really just for ease of testing */
      mrpsptr->ClientAddress = MAPURL_CLIENT_LITERAL;
      mrpsptr->ClientAddressLiteralPtr = SetPathPtr + 15;
      mrpsptr->ClientAddressLiteralLength =
         strlen(mrpsptr->ClientAddressLiteralPtr);
   }
   else
   if (strsame (SetPathPtr, "CLIENT=XFORWARDEDFOR", -1))
      mrpsptr->ClientAddress = MAPURL_CLIENT_XFORWARDEDFOR;
   else
   if (strsame (SetPathPtr, "CLIENT=IF=XFORWARDEDFOR", -1))
      mrpsptr->ClientAddress = MAPURL_CLIENT_IF_XFORWARDEDFOR;
   else
   if (strsame (SetPathPtr, "CLIENT=RESET", -1))
      mrpsptr->ClientAddress = MAPURL_CLIENT_RESET;
   else
   if (strsame (SetPathPtr, "CONTENT=", 8))
   {
      mrpsptr->ContentTypePtr = SetPathPtr + 8;
      mrpsptr->ContentTypeLength = strlen(mrpsptr->ContentTypePtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "CONTENT-TYPE=", 13))
   {
      /* just a synonym for "content=", bet someone uses it! */
      mrpsptr->ContentTypePtr = SetPathPtr + 13;
      mrpsptr->ContentTypeLength = strlen(mrpsptr->ContentTypePtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "CSS=", 4))
   {
      mrpsptr->StyleSheetPtr = SetPathPtr + 4;
      mrpsptr->StyleSheetLength = strlen(mrpsptr->StyleSheetPtr);
   }
   else
   if (strsame (SetPathPtr, "CORS=AGE=", 9))
   {
      sptr = SetPathPtr + 9;
      mrpsptr->CorsMaxAge = MetaConSetSeconds (mcptr, sptr, 1);
      /* negative 1 indicates to revert to configuration maximum */
      if (!mrpsptr->CorsMaxAge) mrpsptr->CorsMaxAge = -1;
   }
   else
   if (strsame (SetPathPtr, "CORS=CRED=TRUE", -1) ||
       strsame (SetPathPtr, "CORS=CRED=YES", -1))
      mrpsptr->CorsAllowCredentials = true;
   else
   if (strsame (SetPathPtr, "CORS=CRED=FALSE", -1) ||
       strsame (SetPathPtr, "CORS=CRED=NO", -1))
      mrpsptr->CorsNoAllowCredentials = true;
   else
   if (strsame (SetPathPtr, "CORS=EXPOSE=", 12))
   {
      mrpsptr->CorsExposeHeadersPtr = SetPathPtr + 12;
      mrpsptr->CorsExposeHeadersLength =
         strlen(mrpsptr->CorsExposeHeadersPtr);
   }
   else
   if (strsame (SetPathPtr, "CORS=HEADERS=", 13))
   {
      mrpsptr->CorsAllowHeadersPtr = SetPathPtr + 13;
      mrpsptr->CorsAllowHeadersLength =
         strlen(mrpsptr->CorsAllowHeadersPtr);
   }
   else
   if (strsame (SetPathPtr, "CORS=METHODS=", 13))
   {
      mrpsptr->CorsAllowMethodsPtr = SetPathPtr + 13;
      mrpsptr->CorsAllowMethodsLength =
         strlen(mrpsptr->CorsAllowMethodsPtr);
   }
   else
   if (strsame (SetPathPtr, "CORS=ORIGIN=", 12))
   {
      mrpsptr->CorsAllowOriginPtr = SetPathPtr + 12;
      mrpsptr->CorsAllowOriginLength =
         strlen(mrpsptr->CorsAllowOriginPtr);
   }
   else
   if (strsame (SetPathPtr, "DICT=", 5))
      mrpsptr->DictionaryPtr = SetPathPtr + 5;
   else
   if (strsame (SetPathPtr, "DIR=ACCESS=SELECTIVE", -1))
      mrpsptr->DirAccessSelective = true;
   else
   if (strsame (SetPathPtr, "DIR=ACCESS", -1))
      mrpsptr->DirAccess = true;
   else
   if (strsame (SetPathPtr, "DIR=NOACCESS", -1))
      mrpsptr->DirNoAccess = true;
   else
   if (strsame (SetPathPtr, "DIR=CHARSET=", 12))
   {
      mrpsptr->DirCharsetPtr = SetPathPtr + 12;
      mrpsptr->DirCharsetLength = strlen(mrpsptr->DirCharsetPtr);
   }
   else
   if (strsame (SetPathPtr, "DIR=DELIMIT", -1) ||
       strsame (SetPathPtr, "DIR=DELIMIT=BOTH", -1))
      mrpsptr->DirDelimit = MAPURL_DIR_DELIMIT_BOTH;
   else
   if (strsame (SetPathPtr, "DIR=DELIMIT=HEADER", -1))
      mrpsptr->DirDelimit = MAPURL_DIR_DELIMIT_HEADER;
   else
   if (strsame (SetPathPtr, "DIR=DELIMIT=FOOTER", -1))
      mrpsptr->DirDelimit = MAPURL_DIR_DELIMIT_FOOTER;
   else
   if (strsame (SetPathPtr, "DIR=DELIMIT=NONE", -1))
      mrpsptr->DirDelimit = MAPURL_DIR_DELIMIT_NONE;
   else
   if (strsame (SetPathPtr, "DIR=FONT", -1) ||
       strsame (SetPathPtr, "DIR=font=MONOSPACE", -1))
      mrpsptr->DirFont = MAPURL_DIR_FONT_MONOSPACE;
   else
   if (strsame (SetPathPtr, "DIR=font=INHERIT", -1))
      mrpsptr->DirFont = MAPURL_DIR_FONT_INHERIT;
   else
   if (strsame (SetPathPtr, "DIR=LAYOUT=", 11))
   {
      mrpsptr->IndexPtr = SetPathPtr + 11;
      mrpsptr->IndexLength = strlen(mrpsptr->IndexPtr);
   }
   else
   if (strsame (SetPathPtr, "DIR=ILINK", -1))
      mrpsptr->DirIconLink = true;
   else
   if (strsame (SetPathPtr, "DIR=NOILINK", -1))
      mrpsptr->DirNoIconLink = true;
   else
   if (strsame (SetPathPtr, "DIR=IMPLIEDWILDCARD", -1))
      mrpsptr->DirImpliedWildcard = true;
   else
   if (strsame (SetPathPtr, "DIR=NOIMPLIEDWILDCARD", -1))
      mrpsptr->DirNoImpliedWildcard = true;
   else
   if (strsame (SetPathPtr, "DIR=SORT=", 9))
   {
      mrpsptr->DirSort[0] = to_upper(SetPathPtr[9]);
      mrpsptr->DirSort[1] = SetPathPtr[10];
   }
   else
   if (strsame (SetPathPtr, "DIR=STYLE", -1) ||
       strsame (SetPathPtr, "DIR=style=DEFAULT", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_DEFAULT;
   else
   if (strsame (SetPathPtr, "DIR=style=DEFAULT2", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_DEFAULT2;
   else
   if (strsame (SetPathPtr, "DIR=style=ANCHOR", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_ANCHOR;
   else
   if (strsame (SetPathPtr, "DIR=style=ANCHOR2", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_ANCHOR2;
   else
   if (strsame (SetPathPtr, "DIR=style=HTDIR", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_HTDIR;
   else
   if (strsame (SetPathPtr, "DIR=style=HTDIR2", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_HTDIR2;
   else
   if (strsame (SetPathPtr, "DIR=style=ORIGINAL", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_ORIGINAL;
   else
   if (strsame (SetPathPtr, "DIR=style=ORIGINAL2", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_ORIGINAL2;
   else
   if (strsame (SetPathPtr, "DIR=style=SORT", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_SORT;
   else
   if (strsame (SetPathPtr, "DIR=style=SORT2", -1))
      mrpsptr->DirStyle = MAPURL_DIR_STYLE_SORT2;
   else
   if (strsame (SetPathPtr, "DIR=TARGET=", 11))
   {
      mrpsptr->DirTargetPtr = SetPathPtr + 11;
      mrpsptr->DirTargetLength = strlen(mrpsptr->DirTargetPtr);
   }
   else
   if (strsame (SetPathPtr, "DIR=title=THIS=", 15))
   {
      mrpsptr->DirTitle = MAPURL_DIR_TITLE_THIS;
      mrpsptr->DirTitlePtr = SetPathPtr + 15;
      mrpsptr->DirTitleLength = strlen(mrpsptr->DirTitlePtr);
   }
   else
   if (strsame (SetPathPtr, "DIR=title=DEFAULT", -1))
      mrpsptr->DirTitle = MAPURL_DIR_TITLE_DEFAULT;
   else
   if (strsame (SetPathPtr, "DIR=title=OWNER", -1))
      mrpsptr->DirTitle = MAPURL_DIR_TITLE_OWNER;
   else
   if (strsame (SetPathPtr, "DIR=title=REMOTE",- 1))
      mrpsptr->DirTitle = MAPURL_DIR_TITLE_REMOTE;
   else
   if (strsame (SetPathPtr, "DIR=title=0", -1))
      mrpsptr->DirTitle = MAPURL_DIR_TITLE_NONE;
   else
   if (strsame (SetPathPtr, "DIR=title=", 10) &&
       isdigit(*(SetPathPtr+10)))
      mrpsptr->DirTitle = atol(SetPathPtr+10);
   else
   if (strsame (SetPathPtr, "DIR=THESE=", 10))
   {
      mrpsptr->DirThesePtr = SetPathPtr + 10;
      mrpsptr->DirTheseLength = strlen(mrpsptr->DirThesePtr);
   }
   else
   if (strsame (SetPathPtr, "DIR=VERSIONS=", 13))
   {
      sptr = SetPathPtr + 13;
      if (*sptr == '*')
         mrpsptr->DirVersionsOf = 65536;
      else
      if (*sptr == '0')
         /* negative one means reset to zero */
         mrpsptr->DirVersionsOf = -1;
      else
         mrpsptr->DirVersionsOf = atoi(sptr);
   }
   else
   if (strsame (SetPathPtr, "DIR=WILDCARD", -1))
      mrpsptr->DirWildcard = true;
   else
   if (strsame (SetPathPtr, "DIR=NOWILDCARD", -1))
      mrpsptr->DirNoWildcard = true;
   else
   if (strsame (SetPathPtr, "NOHTML", 6))
   {
      mrpsptr->NoHtmlEquals = true;
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "HTML=BODYTAG=", 13))
   {
      mrpsptr->HtmlBodyTagPtr = SetPathPtr + 13;
      mrpsptr->HtmlBodyTagLength = strlen(mrpsptr->HtmlBodyTagPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "HTML=FOOTER=", 12))
   {
      mrpsptr->HtmlFooterPtr = SetPathPtr + 12;
      mrpsptr->HtmlFooterLength = strlen(mrpsptr->HtmlFooterPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "HTML=FOOTERTAG=", 15))
   {
      mrpsptr->HtmlFooterTagPtr = SetPathPtr + 15;
      mrpsptr->HtmlFooterTagLength = strlen(mrpsptr->HtmlFooterTagPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "HTML=HEADER=", 12))
   {
      mrpsptr->HtmlHeaderPtr = SetPathPtr + 12;
      mrpsptr->HtmlHeaderLength = strlen(mrpsptr->HtmlHeaderPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "HTML=HEADERTAG=", 15))
   {
      mrpsptr->HtmlHeaderTagPtr = SetPathPtr + 15;
      mrpsptr->HtmlHeaderTagLength = strlen(mrpsptr->HtmlHeaderTagPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "HTTP2=PROTOCOL=1.1", -1))
      mrpsptr->Http2ToHttp11 = true;
   else
   if (strsame (SetPathPtr, "HTTP2=STREAMS=MAX=", 18))
      mrpsptr->Http2MaxStreams = atoi(SetPathPtr+18);
   else
   if (strsame (SetPathPtr, "HTTP2=WRITE=HIGH", -1))
      mrpsptr->Http2WriteQueue = HTTP2_WRITE_QUEUE_HIGH;
   else
   if (strsame (SetPathPtr, "HTTP2=WRITE=NORMAL", -1))
      mrpsptr->Http2WriteQueue = HTTP2_WRITE_QUEUE_NORMAL;
   else
   if (strsame (SetPathPtr, "HTTP2=WRITE=LOW", -1))
      mrpsptr->Http2WriteQueue = HTTP2_WRITE_QUEUE_LOW;
   else
   if (strsame (SetPathPtr, "HTTP2=SEND=GOAWAY", 17))
   {
      /* the optional error code is incremented to allow for zero */
      if (*(sptr = SetPathPtr + 17) == '=')
         mrpsptr->Http2SendGoAway = atoi(sptr+1) + 1;
      else
         mrpsptr->Http2SendGoAway = 1;
   }
   else
   if (strsame (SetPathPtr, "HTTP2=SEND=PING", -1))
      mrpsptr->Http2SendPing = true;
   else
   if (strsame (SetPathPtr, "HTTP2=SEND=RESET", 16))
   {
      /* the optional error code is incremented to allow for zero */
      if (*(sptr = SetPathPtr + 16) == '=')
         mrpsptr->Http2SendReset = atoi(sptr+1) + 1;
      else
         mrpsptr->Http2SendReset = 1;
   }
   else
   if (strsame (SetPathPtr, "HTTP=ACCEPT-CHARSET=", 20))
   {
      mrpsptr->HttpAcceptCharsetPtr = SetPathPtr + 20;
      mrpsptr->HttpAcceptCharsetLength =
         strlen(mrpsptr->HttpAcceptCharsetPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "HTTP=ACCEPT-LANGUAGE=", 21))
   {
      mrpsptr->HttpAcceptLangPtr = SetPathPtr + 21;
      mrpsptr->HttpAcceptLangLength = strlen(mrpsptr->HttpAcceptLangPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "INDEX=", 6))
   {
      mrpsptr->IndexPtr = SetPathPtr + 6;
      mrpsptr->IndexLength = strlen(mrpsptr->IndexPtr);
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "EXPIRED", -1))
   {
      mrpsptr->Expired = true;
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "NOEXPIRED", -1))
   {
      mrpsptr->NoExpired = true;
      *AllowedPtr = true;
   }
   else
   if (strsame (SetPathPtr, "LOG", -1))
      mrpsptr->Log = true;
   else
   if (strsame (SetPathPtr, "NOLOG", -1))
      mrpsptr->NoLog = true;
   else
   if (strsame (SetPathPtr, "MAP=ELLIPSIS", -1))
      mrpsptr->MapEllipsis = true;
   else
   if (strsame (SetPathPtr, "NOMAP=ELLIPSIS", -1) ||
       strsame (SetPathPtr, "MAP=NOELLIPSIS", -1))
      mrpsptr->NoMapEllipsis = false;
   else
   if (strsame (SetPathPtr, "MAPEMPTY", -1) ||
       strsame (SetPathPtr, "MAP=EMPTY", -1))
      mrpsptr->MapEmpty = true;
   else
   if (strsame (SetPathPtr, "NOMAPEMPTY", -1) ||
       strsame (SetPathPtr, "NOMAP=EMPTY", -1) ||
       strsame (SetPathPtr, "MAP=NONEMPTY", -1))
      mrpsptr->MapNonEmpty = true;
   else
   if (strsame (SetPathPtr, "MAP=METHOD", -1))
      mrpsptr->MapExtensionMethod = true;
   else
   if (strsame (SetPathPtr, "MAP=NOMETHOD", -1) ||
       strsame (SetPathPtr, "NOMAP=METHOD", -1))
      mrpsptr->NoMapExtensionMethod = true;
   else
   if (strsame (SetPathPtr, "MAP=ONCE", -1) ||
       strsame (SetPathPtr, "MAPONCE", -1))
      mrpsptr->MapOnce = true;
   else
   if (strsame (SetPathPtr, "MAP=NOONCE", -1) ||
       strsame (SetPathPtr, "NOMAP=ONCE", -1) ||
       strsame (SetPathPtr, "NOMAPONCE", -1))
      mrpsptr->NoMapOnce = true;
   else
   if (strsame (SetPathPtr, "MAP=RESTART", -1))
      mrpsptr->MapRestart = true;
   else
   if (strsame (SetPathPtr, "MAP=ROOT=", 9))
   {
      mrpsptr->MapRootPtr = SetPathPtr + 9;
      mrpsptr->MapRootLength = strlen(mrpsptr->MapRootPtr);
   }
   else
   if (strsame (SetPathPtr, "MAP=SET=REQUEST", -1))
      mrpsptr->MapSetRequest = true;
   else
   if (strsame (SetPathPtr, "NOMAP=SET=REQUEST", -1) ||
       strsame (SetPathPtr, "MAP=SET=NOREQUEST", -1))
      mrpsptr->MapSetNoRequest = true;
   else
   if (strsame (SetPathPtr, "MAP=SET=IGNORE", -1))
      mrpsptr->MapSetIgnore = true;
   else
   if (strsame (SetPathPtr, "NOMAP=SET=IGNORE", -1) ||
       strsame (SetPathPtr, "MAP=SET=NOIGNORE", -1))
      mrpsptr->MapSetNoIgnore = true;
   else
   if (strsame (SetPathPtr, "MAP=URI", -1))
      mrpsptr->MapUri = true;
   else
   if (strsame (SetPathPtr, "NOOP", 4))
      mrpsptr->NoOp = true;
   else
   if (strsame (SetPathPtr, "NOTEPAD=", 8))
      mrpsptr->NotePadPtr = SetPathPtr + 8;
   else
   if (strsame (SetPathPtr, "ODS=0", -1) ||
       strsame (SetPathPtr, "NOODS", -1))
      mrpsptr->PathOds = MAPURL_PATH_ODS_0;
   else
   if (strsame (SetPathPtr, "ODS=2", -1) ||
       strsame (SetPathPtr, "ODS-2", -1))
      mrpsptr->PathOds = MAPURL_PATH_ODS_2;
   else
   if (strsame (SetPathPtr, "ODS=5", -1) ||
       strsame (SetPathPtr, "ODS-5", -1))
   {
      mrpsptr->PathOds = MAPURL_PATH_ODS_5;
#ifdef ODS_EXTENDED
      /* indicate that at least one mapping is set ODS-5 */
      MapUrlPathOds5 = true;
#endif /* ODS_EXTENDED */
   }
   else
   if (strsame (SetPathPtr, "ODS=ADS", -1))
      mrpsptr->PathOds = MAPURL_PATH_ODS_ADS;
   else
   if (strsame (SetPathPtr, "ODS=PWK", -1))
      mrpsptr->PathOds = MAPURL_PATH_ODS_PWK;
   else
   if (strsame (SetPathPtr, "ODS=SMB", -1))
      mrpsptr->PathOds = MAPURL_PATH_ODS_SMB;
   else
   if (strsame (SetPathPtr, "ODS=SRI", -1))
      mrpsptr->PathOds = MAPURL_PATH_ODS_SRI;
   else
   if (strsame (SetPathPtr, "ODS=NAME=8BIT", -1))
      mrpsptr->OdsName = MAPURL_ODS_8BIT;
   else
   if (strsame (SetPathPtr, "ODS=NAME=UTF8", -1))
      mrpsptr->OdsName = MAPURL_ODS_UTF8;
   else
   if (strsame (SetPathPtr, "ODS=NAME=DEFAULT", -1))
      mrpsptr->OdsName = MAPURL_ODS_DEFAULT;
   else
   if (strsame (SetPathPtr, "PROFILE", -1))
      mrpsptr->Profile = true;
   else
   if (strsame (SetPathPtr, "NOPROFILE", -1))
      mrpsptr->NoProfile = true;
   else
   if (strsame (SetPathPtr, "PROXY=AFFINITY", 14))
      mrpsptr->ProxyAffinity = true;
   else
   if (strsame (SetPathPtr, "PROXY=NOAFFINITY", 16) ||
       strsame (SetPathPtr, "NOPROXY=AFFINITY", 16))
      mrpsptr->ProxyNoAffinity = true;
   else
   if (strsame (SetPathPtr, "PROXY=BIND=", 11))
   {
      mrpsptr->ProxyBindIpAddressPtr = SetPathPtr + 11;
      mrpsptr->ProxyBindIpAddressLength =
         strlen(mrpsptr->ProxyBindIpAddressPtr);
   }
   else
   if (strsame (SetPathPtr, "PROXY=CHAIN=CRED=", 17))
   {
      mrpsptr->ProxyChainCredPtr = SetPathPtr + 17;
      mrpsptr->ProxyChainCredLength =
         strlen(mrpsptr->ProxyChainCredPtr);
   }
   else
   if (strsame (SetPathPtr, "PROXY=CHAIN=", 12))
   {
      mrpsptr->ProxyChainHostPortPtr = SetPathPtr + 12;
      mrpsptr->ProxyChainHostPortLength =
         strlen(mrpsptr->ProxyChainHostPortPtr);
   }
   else
   if (strsame (SetPathPtr, "PROXY=NOFORWARDED", -1))
      mrpsptr->ProxyForwardedBy = PROXY_FORWARDED_NONE;
   else
   if (strsame (SetPathPtr, "PROXY=FORWARDED", -1) ||
       strsame (SetPathPtr, "PROXY=FORWARDED=BY", -1))
      mrpsptr->ProxyForwardedBy = PROXY_FORWARDED_BY;
   else
   if (strsame (SetPathPtr, "PROXY=FORWARDED=FOR", -1))
      mrpsptr->ProxyForwardedBy = PROXY_FORWARDED_FOR;
   else
   if (strsame (SetPathPtr, "PROXY=FORWARDED=ADDRESS", -1))
      mrpsptr->ProxyForwardedBy = PROXY_FORWARDED_ADDRESS;
   else
   if (strsame (SetPathPtr, "PROXY=NOXFORWARDEDFOR", -1))
      mrpsptr->ProxyXForwardedFor = PROXY_XFORWARDEDFOR_NONE;
   else
   if (strsame (SetPathPtr, "PROXY=XFORWARDEDFOR", -1) ||
       strsame (SetPathPtr, "PROXY=XFORWARDEDFOR=ENABLED", -1))
      mrpsptr->ProxyXForwardedFor = PROXY_XFORWARDEDFOR_ENABLED;
   else
   if (strsame (SetPathPtr, "PROXY=XFORWARDEDFOR=ADDRESS", -1))
      mrpsptr->ProxyXForwardedFor = PROXY_XFORWARDEDFOR_ADDRESS;
   else
   if (strsame (SetPathPtr, "PROXY=XFORWARDEDFOR=UNKNOWN", -1))
      mrpsptr->ProxyXForwardedFor = PROXY_XFORWARDEDFOR_UNKNOWN;
   else
   if (strsame (SetPathPtr, "PROXY=HEADER=", 13))
   {
      if (mrpsptr->ProxyHeaderCount < MAPURL_PROXY_HEADER_MAX)
         mrpsptr->ProxyHeader[mrpsptr->ProxyHeaderCount++] =
            SetPathPtr + 13;
      else
         MetaConReport (mcptr, METACON_REPORT_ERROR,
                        ProblemProxyHeader);
   }
   else
   if (strsame (SetPathPtr, "PROXY=REVERSE=LOCATION=", 23))
   {
      mrpsptr->ProxyReverseLocationPtr = SetPathPtr + 23;
      mrpsptr->ProxyReverseLocationLength =
         strlen(mrpsptr->ProxyReverseLocationPtr);
   }
   else
   if (strsame (SetPathPtr, "PROXY=REWORK=", 13))
   {
      mrpsptr->ProxyReworkPtr = SetPathPtr + 13;
      mrpsptr->ProxyReworkLength = strlen(mrpsptr->ProxyReworkPtr);
   }
   else
   if (strsame (SetPathPtr, "PROXY=REVERSE=VERIFY", -1))
      mrpsptr->ProxyReverseVerify = true;
   else
   if (strsame (SetPathPtr, "PROXY=REVERSE=NOVERIFY", -1) ||
       strsame (SetPathPtr, "NOPROXY=REVERSE=VERIFY", -1))
      mrpsptr->NoProxyReverseVerify = true;
   else
   if (strsame (SetPathPtr, "PROXY=REVERSE=AUTH", -1))
      mrpsptr->ProxyReverseAuthHeader = true;
   else
   if (strsame (SetPathPtr, "PROXY=REVERSE=NOAUTH", -1) ||
       strsame (SetPathPtr, "NOPROXY=REVERSE=AUTH", -1))
      mrpsptr->NoProxyReverseAuthHeader = true;
   else
   if (strsame (SetPathPtr, "PROXY=TUNNEL=REQUEST=", 21))
   {
      mrpsptr->ProxyTunnelRequestPtr = SetPathPtr + 21;
      mrpsptr->ProxyTunnelRequestLength =
         strlen(mrpsptr->ProxyTunnelRequestPtr);
   }
   else
   if (strsame (SetPathPtr, "PROXY=UNKNOWN", -1))
      mrpsptr->ProxyUnknownRequestFields = true;
   else
   if (strsame (SetPathPtr, "PROXY=NOUNKNOWN", -1) ||
       strsame (SetPathPtr, "NOPROXY=UNKNOWN", -1))
      mrpsptr->NoProxyUnknownRequestFields = true;
   else
   if (strsame (SetPathPtr, "PUT=RFM=FIX512", -1))
      mrpsptr->PutRFM = PUT_RFM_FIX512;
   else
   if (strsame (SetPathPtr, "PUT=RFM=STM", -1))
      mrpsptr->PutRFM = PUT_RFM_STM;
   else
   if (strsame (SetPathPtr, "PUT=RFM=STMCR", -1))
      mrpsptr->PutRFM = PUT_RFM_STMCR;
   else
   if (strsame (SetPathPtr, "PUT=RFM=STMLF", -1))
      mrpsptr->PutRFM = PUT_RFM_STMLF;
   else
   if (strsame (SetPathPtr, "PUT=RFM=UDF", -1))
      mrpsptr->PutRFM = PUT_RFM_UDF;
   else
   if (strsame (SetPathPtr, "PUT=MAX=", 8))
   {
      if (*(SetPathPtr+8) == '*')
         /* no limit is actually 4GB - current HTTP atol() constraint */
         mrpsptr->PutMaxKbytes = 999999999;
      else
         mrpsptr->PutMaxKbytes = atoi(SetPathPtr+8);
   }
   else
   if (strsame (SetPathPtr, "QUERY-STRING=", 13))
   {
      mrpsptr->QueryStringPtr = SetPathPtr + 13;
      mrpsptr->QueryStringLength = strlen(mrpsptr->QueryStringPtr);
   }
   else
   if (strsame (SetPathPtr, "REGEX=AWK", 9))
      mrpsptr->RegexSyntax = RE_SYNTAX_AWK;
   else
   if (strsame (SetPathPtr, "DEFAULT", 7))
      mrpsptr->RegexSyntax = -1;
   else
   if (strsame (SetPathPtr, "REGEX=ED", 8))
      mrpsptr->RegexSyntax = RE_SYNTAX_ED;
   else
   if (strsame (SetPathPtr, "REGEX=EGREP", 11))
      mrpsptr->RegexSyntax = RE_SYNTAX_EGREP;
   else
   if (strsame (SetPathPtr, "REGEX=GREP", 10))
      mrpsptr->RegexSyntax = RE_SYNTAX_GREP;
   else
   if (strsame (SetPathPtr, "REGEX=POSIX_AWK", 15))
      mrpsptr->RegexSyntax = RE_SYNTAX_POSIX_AWK;
   else
   if (strsame (SetPathPtr, "REGEX=POSIX_BASIC", 17))
      mrpsptr->RegexSyntax = RE_SYNTAX_POSIX_BASIC;
   else
   if (strsame (SetPathPtr, "REGEX=POSIX_EGREP", 17))
      mrpsptr->RegexSyntax = RE_SYNTAX_POSIX_EGREP;
   else
   if (strsame (SetPathPtr, "REGEX=POSIX_EXTENDED", 20))
      mrpsptr->RegexSyntax = RE_SYNTAX_POSIX_EXTENDED;
   else
   if (strsame (SetPathPtr, "REGEX=POSIX_MINIMAL_BASIC", 25))
      mrpsptr->RegexSyntax = RE_SYNTAX_POSIX_MINIMAL_BASIC;
   else
   if (strsame (SetPathPtr, "REGEX=POSIX_MINIMAL_EXTENDED", 28))
      mrpsptr->RegexSyntax = RE_SYNTAX_POSIX_MINIMAL_EXTENDED;
   else
   if (strsame (SetPathPtr, "REGEX=SED", 9))
      mrpsptr->RegexSyntax = RE_SYNTAX_AWK;
   else
   if (strsame (SetPathPtr, "REGEX=WASD", 10))
      mrpsptr->RegexSyntax = REGEX_C_FLAGS;
   else
   if (strsame (SetPathPtr, "REGEX=", 6) && isdigit(SetPathPtr[6]))
      mrpsptr->RegexSyntax = atoi(SetPathPtr+6);
   else
   if (strsame (SetPathPtr, "REPORT=BASIC", 10))
      mrpsptr->ReportType = ERROR_REPORT_BASIC;
   else
   if (strsame (SetPathPtr, "REPORT=DETAILED", 10))
      mrpsptr->ReportType = ERROR_REPORT_DETAILED;
   else
   if (strsame (SetPathPtr, "REPORT=TUNNEL", 10))
      mrpsptr->ReportType = ERROR_REPORT_TUNNEL;
   else
   if (strsame (SetPathPtr, "REPORT=400=", 11))
      mrpsptr->Report400as = atoi(SetPathPtr+11);
   else
   if (strsame (SetPathPtr, "REPORT=403=", 11))
      mrpsptr->Report403as = atoi(SetPathPtr+11);
   else
   if (strsame (SetPathPtr, "REPORT=404=", 11))
      mrpsptr->Report404as = atoi(SetPathPtr+11);
   else
   if (strsame (SetPathPtr, "RMSCHAR=", 8))
      mrpsptr->RmsSubChar = SetPathPtr[8];
   else
   if (strsame (SetPathPtr, "RESPONSE=200=203", -1))
      mrpsptr->Response200is203 = 203;
   else
   if (strsame (SetPathPtr, "RESPONSE=203=200", -1))
      mrpsptr->Response200is203 = 200;
   else
   if (strsame (SetPathPtr, "RESPONSE=CSP=", 13))
   {
      mrpsptr->ResponseCspPtr = SetPathPtr + 13;
      if (!(mrpsptr->ResponseCspLength =
            strlen(mrpsptr->ResponseCspPtr)))
      {
         mrpsptr->ResponseCspPtr = NULL;
         mrpsptr->ResponseCspLength = -1;
      }
   }
   else
   if (strsame (SetPathPtr, "NORESPONSE=CSP", -1) ||
       strsame (SetPathPtr, "RESPONSE=NOCSP", -1))
   {
      mrpsptr->ResponseCspPtr = NULL;
      mrpsptr->ResponseCspLength = -1;
   }
   else
   if (strsame (SetPathPtr, "RESPONSE=CSPRO=", 15))
   {
      mrpsptr->ResponseCsproPtr = SetPathPtr + 15;
      if (!(mrpsptr->ResponseCsproLength =
            strlen(mrpsptr->ResponseCsproPtr)))
      {
         mrpsptr->ResponseCspPtr = NULL;
         mrpsptr->ResponseCspLength = -1;
      }
   }
   else
   if (strsame (SetPathPtr, "NORESPONSE=CSPRO", -1) ||
       strsame (SetPathPtr, "RESPONSE=NOCSPRO", -1))
   {
      mrpsptr->ResponseCsproPtr = NULL;
      mrpsptr->ResponseCsproLength = -1;
   }
   else
   if (strsame (SetPathPtr, "RESPONSE=GZIP=ALL", -1) ||
       strsame (SetPathPtr, "RESPONSE=GZIP=0", -1))
      mrpsptr->ResponseGzip = MAPURL_RESPONSE_GZIP_ALL;
   else
   if (strsame (SetPathPtr, "RESPONSE=GZIP=NONE", -1))
      mrpsptr->ResponseGzip = MAPURL_RESPONSE_GZIP_NONE;
   else
   if (strsame (SetPathPtr, "RESPONSE=GZIP=", 14))
      mrpsptr->ResponseGzip = atoi(SetPathPtr+14);
   else
   if (strsame (SetPathPtr, "RESPONSE=CHUNKED", 14))
      mrpsptr->ResponseChunked = true;
   else
   if (strsame (SetPathPtr, "NORESPONSE=CHUNKED", 16) ||
       strsame (SetPathPtr, "RESPONSE=NOCHUNKED", 16))
      mrpsptr->ResponseNoChunked = true;
   else
   if (strsame (SetPathPtr, "RESPONSE=HEADER=BEGIN", -1))
      mrpsptr->ResponseHeaderBegin = true;
   else
   if (strsame (SetPathPtr, "RESPONSE=HEADER=FULL", -1))
      mrpsptr->ResponseHeaderFull = true;
   else
   if (strsame (SetPathPtr, "RESPONSE=HEADER=NONE", -1))
      mrpsptr->ResponseHeaderNone = true;
   else
   if (strsame (SetPathPtr, "NORESPONSE=HEADER=ADD", -1) ||
       strsame (SetPathPtr, "RESPONSE=HEADER=NOADD", -1))
      mrpsptr->ResponseHeaderNoAdd = true;
   else
   if (strsame (SetPathPtr, "RESPONSE=HEADER=ADD=", 20))
   {
      mrpsptr->ResponseHeaderAddPtr = SetPathPtr + 20;
      mrpsptr->ResponseHeaderAddLength =
         strlen(mrpsptr->ResponseHeaderAddPtr);
   }
   else
   if (strsame (SetPathPtr, "RESPONSE=HTTP=ORIGINAL", -1))
      mrpsptr->ResponseHttpOriginal = true;
   else
   if (strsame (SetPathPtr, "NORESPONSE=HTTP=ORIGINAL", -1) ||
       strsame (SetPathPtr, "RESPONSE=HTTP=NOORIGINAL", -1))
      mrpsptr->ResponseHttpNoOriginal = true;
   else
   if (strsame (SetPathPtr, "RESPONSE=STS=", 13))
   {
      mrpsptr->ResponseStrictTransSecPtr = SetPathPtr+13;
      mrpsptr->ResponseStrictTransSecLength =
         strlen(mrpsptr->ResponseStrictTransSecPtr);
   }
   else
   if (strsame (SetPathPtr, "RESPONSE=VAR=ASIS", -1))
      mrpsptr->ResponseVarRecord = FILE_VAR_ASIS;
   else
   if (strsame (SetPathPtr, "RESPONSE=VAR", -1))
      mrpsptr->ResponseVarRecord = FILE_VAR_DEFAULT;
   else
   if (strsame (SetPathPtr, "RESPONSE=VAR=CRLF", -1))
      mrpsptr->ResponseVarRecord = FILE_VAR_CRLF;
   else
   if (strsame (SetPathPtr, "RESPONSE=VAR=LF", -1))
      mrpsptr->ResponseVarRecord = FILE_VAR_LF;
   else
   if (strsame (SetPathPtr, "RESPONSE=VAR=NONE", -1))
      mrpsptr->ResponseVarRecord = FILE_VAR_NONE;
   else
   if (strsame (SetPathPtr, "SCRIPT=AGENT=AS=", 16))
   {
      /* while setting the required pointers force to upper-case */
      for (sptr = mrpsptr->ScriptAgentAsPtr = SetPathPtr+16;
          *sptr;
          sptr++)
         *sptr = to_upper(*sptr);
      mrpsptr->ScriptAgentAsLength = strlen(mrpsptr->ScriptAgentAsPtr);
   }
   else
   if (strsame (SetPathPtr, "SCRIPT=AS=", 10))
   {
      /* while setting the required pointers force to upper-case */
      for (sptr = mrpsptr->ScriptAsPtr = SetPathPtr+10; *sptr; sptr++)
         *sptr = to_upper(*sptr);
      mrpsptr->ScriptAsLength = strlen(mrpsptr->ScriptAsPtr);
   }
   else
   if (strsame (SetPathPtr, "SCRIPT=BIT-BUCKET=", 18))
      mrpsptr->ScriptBitBucketTimeout =
         MetaConSetSeconds (mcptr, SetPathPtr+18, 1);
   else
   if (strsame (SetPathPtr, "SCRIPT=BODY=DECODE", -1))
      mrpsptr->ScriptBodyDecode = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=BODY=NODECODE", -1) ||
       strsame (SetPathPtr, "SCRIPT=NOBODY=DECODE", -1) ||
       strsame (SetPathPtr, "NOSCRIPT=BODY=DECODE", -1))
      mrpsptr->ScriptBodyNoDecode = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=CPU=", 11))
      mrpsptr->ScriptCpuMax = MetaConSetSeconds (mcptr, SetPathPtr+11, 1);
   else
   if (strsame (SetPathPtr, "SCRIPT=COMMAND=", 15))
   {
      mrpsptr->ScriptCommandPtr = SetPathPtr + 15;
      mrpsptr->ScriptCommandLength = strlen(mrpsptr->ScriptCommandPtr);
   }
   else
   if (strsame (SetPathPtr, "SCRIPT=CONTROL=", 15))
   {
      mrpsptr->ScriptControlPtr = SetPathPtr + 15;
      mrpsptr->ScriptControlLength = strlen(mrpsptr->ScriptControlPtr);
   }
   else
   if (strsame (SetPathPtr, "SCRIPT=DEFAULT=", 15))
   {
      mrpsptr->ScriptDefaultPtr = SetPathPtr + 15;
      mrpsptr->ScriptDefaultLength = strlen(mrpsptr->ScriptDefaultPtr);
   }
   else
   if (strsame (SetPathPtr, "SCRIPT=FIND", -1))
      mrpsptr->ScriptFind = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=NOFIND", -1) ||
       strsame (SetPathPtr, "NOSCRIPT=FIND", -1))
      mrpsptr->ScriptNoFind = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=LIFETIME=", 16))
      mrpsptr->ScriptLifeTime =
         MetaConSetSeconds (mcptr, SetPathPtr+16, 1);
   else
   if (strsame (SetPathPtr, "SCRIPT=SYMBOL=TRUNCATE", -1))
      mrpsptr->ScriptSymbolTruncate = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=SYMBOL=NOTRUNCATE", -1) ||
       strsame (SetPathPtr, "NOSCRIPT=SYMBOL=TRUNCATE", -1))
      mrpsptr->ScriptSymbolNoTruncate = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=SYNTAX=UNIX", -1))
      mrpsptr->ScriptSyntaxUnix = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=SYNTAX=NOUNIX", -1) ||
       strsame (SetPathPtr, "NOSCRIPT=SYNTAX=UNIX", -1))
      mrpsptr->ScriptSyntaxNoUnix = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=PARAM=", 13))
   {
      mrpsptr->ScriptParamsPtr = SetPathPtr + 13;
      mrpsptr->ScriptParamsLength =
         strlen(mrpsptr->ScriptParamsPtr);
   }
   else
   if (strsame (SetPathPtr, "SCRIPT=PARAMS=", 14))
   {
      mrpsptr->ScriptParamsPtr = SetPathPtr + 14;
      mrpsptr->ScriptParamsLength =
         strlen(mrpsptr->ScriptParamsPtr);
   }
   else
   if (strsame (SetPathPtr, "SCRIPT=PATH=FIND", -1))
      mrpsptr->ScriptPathFind = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=NOPATH=FIND", -1) ||
       strsame (SetPathPtr, "NOSCRIPT=PATH=FIND", -1))
      mrpsptr->ScriptNoPathFind = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=QUERY=NONE", -1))
      mrpsptr->ScriptQueryNone = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=NOQUERY=NONE", -1) ||
       strsame (SetPathPtr, "NOSCRIPT=QUERY=NONE", -1))
      mrpsptr->ScriptNoQueryNone = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=QUERY=RELAXED", -1))
      mrpsptr->ScriptQueryRelaxed = true;
   else
   if (strsame (SetPathPtr, "SCRIPT=NOQUERY=RELAXED", -1) ||
       strsame (SetPathPtr, "NOSCRIPT=QUERY=RELAXED", -1))
      mrpsptr->ScriptNoQueryRelaxed = true;
   else
   if (strsame (SetPathPtr, "SEARCH=NONE", -1))
      mrpsptr->NoDefaultSearch = true;
   else
   if (strsame (SetPathPtr, "NOSEARCH=NONE", -1) ||
       strsame (SetPathPtr, "SEARCH=NONONE", -1))
      mrpsptr->DefaultSearch = true;
   else
   if (strsame (SetPathPtr, "SERVICE=", 8))
   {
      mrpsptr->ChangeServicePtr = SetPathPtr + 8;
      mrpsptr->ChangeServiceLength =
         strlen(mrpsptr->ChangeServicePtr);
   }
   else
   if (strsame (SetPathPtr, "SSI=PRIV", 8))
      mrpsptr->PrivSsi = true;
   else
   if (strsame (SetPathPtr, "SSI=NOPRIV", -1) ||
       strsame (SetPathPtr, "NOSSI=PRIV", -1))
      mrpsptr->NoPrivSsi = true;
   else
   if (strsame (SetPathPtr, "SSI=EXEC=", 9))
   {
      mrpsptr->SsiExecPtr = SetPathPtr + 9;
      mrpsptr->SsiExecLength =
         strlen(mrpsptr->SsiExecPtr);
   }
   else
   if (strsame (SetPathPtr, "SSI=DCL=", 8))
   {
      /* synonym for 'ssi=exec=' */
      mrpsptr->SsiExecPtr = SetPathPtr + 8;
      mrpsptr->SsiExecLength =
         strlen(mrpsptr->SsiExecPtr);
   }
   else
   if (strsame (SetPathPtr, "NOSSLCGI", -1))
      mrpsptr->SSLCGIvar = SESOLA_CGI_VAR_NONE;
   else
   if (strsame (SetPathPtr, "SSLCGI=NONE", -1))
      mrpsptr->SSLCGIvar = SESOLA_CGI_VAR_NONE;
   else
   if (strsame (SetPathPtr, "SSLCGI=APACHE_MOD_SSL", -1))
      mrpsptr->SSLCGIvar = SESOLA_CGI_VAR_APACHE_MOD_SSL;
   else
   if (strsame (SetPathPtr, "SSLCGI=APACHE_MOD_SSL_CLIENT", -1))
      mrpsptr->SSLCGIvar = SESOLA_CGI_VAR_APACHE_MOD_SSL_CLIENT;
   else
   if (strsame (SetPathPtr, "SSLCGI=APACHE_MOD_SSL_EXTENS", -1))
      mrpsptr->SSLCGIvar = SESOLA_CGI_VAR_APACHE_MOD_SSL_EXTENS;
   else
   if (strsame (SetPathPtr, "SSLCGI=APACHE_MOD_SSL_OID", -1))
      mrpsptr->SSLCGIvar = SESOLA_CGI_VAR_APACHE_MOD_SSL_OID;
   else
   if (strsame (SetPathPtr, "SSLCGI=PURVEYOR", -1))
      mrpsptr->SSLCGIvar = SESOLA_CGI_VAR_PURVEYOR;
   else
   if (strsame (SetPathPtr, "STMLF", -1))
      mrpsptr->StmLF = true;
   else
   if (strsame (SetPathPtr, "NOSTMLF", -1))
      mrpsptr->NoStmLF = true;
   else
   if (strsame (SetPathPtr, "THROTTLE=", 9))
   {
      mrpsptr->ThrottleSet = true;
      SetPathPtr += 9;
      if (strsame (SetPathPtr, "BUSY=", 5))
         mrpsptr->ThrottleBusy = atoi(SetPathPtr+5);
      else
      if (strsame (SetPathPtr, "FROM=", 5))
      {
         sptr = SetPathPtr + 5;
         mrpsptr->ThrottleFrom = atoi(sptr);
         while (isdigit(*sptr)) sptr++;
         if (*sptr == '$') mrpsptr->ThrottlePerUser = atoi(sptr+1);
      }
      else
      if (strsame (SetPathPtr, "RESUME=", 7))
         mrpsptr->ThrottleResume = atoi(SetPathPtr+7);
      else
      if (strsame (SetPathPtr, "TO=", 3))
         mrpsptr->ThrottleTo = atoi(SetPathPtr+3);
      else
      if (strsame (SetPathPtr, "TIMEOUT=BUSY=", 13))
         mrpsptr->ThrottleTimeoutBusy =
            MetaConSetSeconds (mcptr, SetPathPtr+13, 1);
      else
      if (strsame (SetPathPtr, "TIMEOUT=QUEUE=", 14))
         mrpsptr->ThrottleTimeoutQueue =
            MetaConSetSeconds (mcptr, SetPathPtr+14, 1);
      else
      if (strsame (SetPathPtr, "USER=", 5))
         mrpsptr->ThrottlePerUser = atoi(SetPathPtr+5);
      else
      if (strsame (SetPathPtr, "NONE", 4))
         mrpsptr->ThrottleNoSet = true;
      else
      {
         /* throttle=from[/user],to,resume,busy,t/o-queue,t/o-busy */
         sptr = SetPathPtr;
         if (*sptr == '(') sptr++;
         if (isdigit(*sptr)) mrpsptr->ThrottleFrom = atoi(sptr);
         while (isdigit(*sptr)) *sptr++;
         if (*sptr == '/')
         {
            sptr++;
            mrpsptr->ThrottlePerUser = atoi(sptr);
            while (isdigit(*sptr)) *sptr++;
         }
         if (*sptr == ',') *sptr++;
         if (isdigit(*sptr)) mrpsptr->ThrottleTo = atoi(sptr);
         while (isdigit(*sptr)) *sptr++;
         if (*sptr == ',') *sptr++;
         if (isdigit(*sptr)) mrpsptr->ThrottleResume = atoi(sptr);
         while (isdigit(*sptr)) *sptr++;
         if (*sptr == ',') *sptr++;
         if (isdigit(*sptr)) mrpsptr->ThrottleBusy = atoi(sptr);
         while (isdigit(*sptr)) *sptr++;
         if (*sptr == ',') *sptr++;
         if (isdigit(*sptr))
            mrpsptr->ThrottleTimeoutQueue =
               MetaConSetSeconds (mcptr, sptr, 1);
         while (*sptr && (isdigit(*sptr) || *sptr == ':')) *sptr++;
         if (*sptr == ',') *sptr++;
         if (isdigit(*sptr))
            mrpsptr->ThrottleTimeoutBusy =
               MetaConSetSeconds (mcptr, sptr, 1);
         while (*sptr && (isdigit(*sptr) || *sptr == ':')) *sptr++;
      }
   }
   else
   if (strsame (SetPathPtr, "TIMEOUT=PERSISTENT=", 19))
      mrpsptr->TimeoutPersistent =
         MetaConSetSeconds (mcptr, SetPathPtr+19, 1);
   else
   /* for backward compatibility against the above */
   if (strsame (SetPathPtr, "TIMEOUT=KEEPALIVE=", 18))
      mrpsptr->TimeoutPersistent =
         MetaConSetSeconds (mcptr, SetPathPtr+18, 1);
   else
   if (strsame (SetPathPtr, "TIMEOUT=NOPROGRESS=", 19))
      mrpsptr->TimeoutNoProgress =
         MetaConSetSeconds (mcptr, SetPathPtr+19, 1);
   else
   if (strsame (SetPathPtr, "TIMEOUT=OUTPUT=", 15))
      mrpsptr->TimeoutOutput =
         MetaConSetSeconds (mcptr, SetPathPtr+15, 1);
   else
   if (strsame (SetPathPtr, "TIMEOUT=", 8))
   {
      sptr = SetPathPtr+8;
      mrpsptr->TimeoutPersistent = MetaConSetSeconds (mcptr, sptr, 1);
      while (*sptr && !ISLWS(*sptr) && *sptr != ',') *sptr++;
      if (*sptr == ',') *sptr++;
      mrpsptr->TimeoutNoProgress = MetaConSetSeconds (mcptr, sptr, 1);
      while (*sptr && !ISLWS(*sptr) && *sptr != ',') *sptr++;
      if (*sptr == ',') *sptr++;
      mrpsptr->TimeoutOutput = MetaConSetSeconds (mcptr, sptr, 1);
   }
   else
   if (strsame (SetPathPtr, "NOTIMEOUT", -1))
      mrpsptr->TimeoutNoProgress =
        mrpsptr->TimeoutPersistent =
        mrpsptr->TimeoutOutput = -1;
   else
   if (strsame (SetPathPtr, "ACCESS=PROFILE", -1))
      mrpsptr->AccessProfile = true;
   else
   if (strsame (SetPathPtr, "ACCESS=NOPROFILE", -1) ||
       strsame (SetPathPtr, "NOACCESS=PROFILE", -1))
      mrpsptr->AccessNoProfile = true;
   else
   if (strsame (SetPathPtr, "ACCESS=READ", -1))
      mrpsptr->AccessRead = true;
   else
   if (strsame (SetPathPtr, "ACCESS=NOREAD", -1) ||
       strsame (SetPathPtr, "NOACCESS=READ", -1))
      mrpsptr->AccessNoRead = true;
   else
   if (strsame (SetPathPtr, "ACCESS=SERVER", -1))
      mrpsptr->AccessServer = true;
   else
   if (strsame (SetPathPtr, "ACCESS=NOSERVER", -1) ||
       strsame (SetPathPtr, "NOACCESS=SERVER", -1))
      mrpsptr->AccessNoServer = true;
   else
   if (strsame (SetPathPtr, "ACCESS=WRITE", -1))
      mrpsptr->AccessWrite = true;
   else
   if (strsame (SetPathPtr, "ACCESS=NOWRITE", -1) ||
       strsame (SetPathPtr, "NOACCESS=WRITE", -1))
      mrpsptr->AccessNoWrite = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=ALL", -1))
      mrpsptr->WebDavAll = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOALL", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=ALL", -1))
      mrpsptr->WebDavNoAll = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=AUTH", -1))
      mrpsptr->WebDavAuth = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOAUTH", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=AUTH", -1))
      mrpsptr->WebDavNoAuth = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=HIDDEN", -1))
      mrpsptr->WebDavHidden = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOHIDDEN", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=HIDDEN", -1))
      mrpsptr->WebDavNoHidden = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=LOCKING", 11))
      mrpsptr->WebDavLock = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOLOCKING", 13) ||
       strsame (SetPathPtr, "NOWEBDAV=LOCKING", 13))
      mrpsptr->WebDavNoLock = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=META=DIR=", 16))
   {
      mrpsptr->WebDavMetaDirPtr = SetPathPtr + 16;
      mrpsptr->WebDavMetaDirLength = strlen(mrpsptr->WebDavMetaDirPtr);
   }
   else
   if (strsame (SetPathPtr, "WEBDAV=PROFILE", -1))
      mrpsptr->WebDavProfile = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOPROFILE", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=PROFILE", -1))
      mrpsptr->WebDavNoProfile = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=PROP", -1))
      mrpsptr->WebDavProp = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOPROP", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=PROP", -1))
      mrpsptr->WebDavNoProp = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=PUT=LOCK", -1))
      mrpsptr->WebDavPutLock = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOPUT=LOCK", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=PUT=LOCK", -1))
      mrpsptr->WebDavNoPutLock = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=READ", -1))
      mrpsptr->WebDavRead = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOREAD", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=READ", -1))
      mrpsptr->WebDavNoRead = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=SERVER", -1))
      mrpsptr->WebDavServer = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOSERVER", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=SERVER", -1))
      mrpsptr->WebDavNoServer = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=WINPROP", -1))
      mrpsptr->WebDavWinProp = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOWINPROP", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=WINPROP", -1))
      mrpsptr->WebDavNoWinProp = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=WRITE", -1))
      mrpsptr->WebDavWrite = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=NOWRITE", -1) ||
       strsame (SetPathPtr, "NOWEBDAV=WRITE", -1))
      mrpsptr->WebDavNoWrite = true;
   else
   if (strsame (SetPathPtr, "WEBDAV=LOCK=TIMEOUT=DEFAULT=", 28))
      mrpsptr->WebDavLockTimeoutDefault =
         MetaConSetSeconds (mcptr, SetPathPtr+28, 1);
   else
   if (strsame (SetPathPtr, "WEBDAV=LOCK=TIMEOUT=MAX=", 24))
      mrpsptr->WebDavLockTimeoutMax =
         MetaConSetSeconds (mcptr, SetPathPtr+24, 1);
   else
   if (strsame (SetPathPtr, "WEBSOCKET=INPUT=", 16))
      mrpsptr->WebSocketInputSize = atoi(SetPathPtr+16);
   else
   if (strsame (SetPathPtr, "WEBSOCKET=OUTPUT=", 17))
      mrpsptr->WebSocketOutputSize = atoi(SetPathPtr+17);
   else
   {
      MetaConReport (mcptr, METACON_REPORT_ERROR, ProblemSetPath);
      return (false);
   }

   return (true);
}

/*****************************************************************************/
/*
The path has a setting.get wasd.h
  Map that onto the request path settings.
*/ 
 
MapSetPath
(
REQUEST_STRUCT *rqptr,
REQUEST_PATHSET *rqpsptr,
MAP_SET_META *mrpsptr
)
{
   int  length, size;
   char  *cptr, *sptr;

   /*********/
   /* begin */
   /*********/

   if (WATCHMOD (rqptr, WATCH_MOD_MAPURL))
      WatchThis (WATCHITM(rqptr), WATCH_MOD_MAPURL, "MapSetPath()");

   if (mrpsptr->NoAcceptLang)
   {
      rqpsptr->AcceptLangChar = '\0';
      rqpsptr->AcceptLangWildcard =
         rqpsptr->AcceptLangTypeVariant = false;
      rqpsptr->AcceptLangPtr = NULL;
   }
   else
   if (mrpsptr->AcceptLangChar)
   {
      rqpsptr->AcceptLangChar = mrpsptr->AcceptLangChar;
      rqpsptr->AcceptLangWildcard = mrpsptr->AcceptLangWildcard;
      rqpsptr->AcceptLangTypeVariant = mrpsptr->AcceptLangTypeVariant;
      if (mrpsptr->AcceptLangLength)
      {
         rqpsptr->AcceptLangPtr =
            VmGetHeap (rqptr, mrpsptr->AcceptLangLength+1);
         memcpy (rqpsptr->AcceptLangPtr,
                 mrpsptr->AcceptLangPtr,
                 mrpsptr->AcceptLangLength+1);
      }
   }

   if (mrpsptr->NoAlert)
      rqpsptr->Alert = 0;
   else
   if (mrpsptr->Alert)
      rqpsptr->Alert = mrpsptr->Alert;

   if (mrpsptr->NoAuthAll)
      rqpsptr->AuthorizeAll = false;
   else
   if (mrpsptr->AuthAll)
      rqpsptr->AuthorizeAll = true;

   if (mrpsptr->NoAuthMapped)
      rqpsptr->AuthorizeMapped = false;
   else
   if (mrpsptr->AuthMapped)
      rqpsptr->AuthorizeMapped = true;

   if (mrpsptr->NoAuthOnce)
      rqpsptr->AuthorizeOnce = false;
   else
   if (mrpsptr->AuthOnce)
      rqpsptr->AuthorizeOnce = true;

   /* only if they haven't been set in any previous pass */
   if (!rqpsptr->AuthRevalidateTimeout)
      rqpsptr->AuthRevalidateTimeout = mrpsptr->AuthRevalidateTimeout;

   if (mrpsptr->AuthSysUafPwdExpUrlLength)
   {
      rqpsptr->AuthSysUafPwdExpUrlPtr =
         VmGetHeap (rqptr, mrpsptr->AuthSysUafPwdExpUrlLength+1);
      memcpy (rqpsptr->AuthSysUafPwdExpUrlPtr,
              mrpsptr->AuthSysUafPwdExpUrlPtr,
              mrpsptr->AuthSysUafPwdExpUrlLength+1);
   }

   if (mrpsptr->NoCache)
   {
      rqpsptr->NoCache = true;
      rqpsptr->CacheCGI =
         rqpsptr->CacheCookie =
         rqpsptr->CacheNoFile =
         rqpsptr->CacheNet =
         rqpsptr->CacheNPH =
         rqpsptr->CachePermanent =
         rqpsptr->CacheQuery = false;
      rqpsptr->CacheExpiresAfter =
         rqpsptr->CacheGuardSeconds =
         rqpsptr->CacheMaxKBytes = 0;
   }
   else
   if (mrpsptr->CacheSetting)
   {
      if (mrpsptr->Cache)
         rqpsptr->NoCache = rqpsptr->CacheNoFile = false;

      if (mrpsptr->CacheNoCGI)
         rqpsptr->CacheCGI = false;
      else
      if (mrpsptr->CacheCGI)
         rqpsptr->CacheCGI = true;

      if (mrpsptr->CacheNoCookie)
         rqpsptr->CacheCookie = false;
      else
      if (mrpsptr->CacheCookie)
         rqpsptr->CacheCookie = true;

      if (mrpsptr->CacheNoFile)
         rqpsptr->CacheNoFile = true;
      else
      if (mrpsptr->CacheFile)
         rqpsptr->CacheNoFile = false;

      if (mrpsptr->CacheNoNet)
         rqpsptr->CacheNet = false;
      else
      if (mrpsptr->CacheNet)
         rqpsptr->CacheNet = true;

      if (mrpsptr->CacheNoNPH)
         rqpsptr->CacheNPH = false;
      else
      if (mrpsptr->CacheNPH)
         rqpsptr->CacheNPH = true;

      if (mrpsptr->CacheNoPermanent)
         rqpsptr->CachePermanent = false;
      else
      if (mrpsptr->CachePermanent)
         rqpsptr->CachePermanent = true;

      if (mrpsptr->CacheNoQuery)
         rqpsptr->CacheQuery = false;
      else
      if (mrpsptr->CacheQuery)
         rqpsptr->CacheQuery = true;

      if (mrpsptr->CacheNoScript)
         rqpsptr->CacheCGI = rqpsptr->CacheNPH = false;
      else
      if (mrpsptr->CacheScript)
         rqpsptr->CacheCGI = rqpsptr->CacheNPH = true;

      if (mrpsptr->CacheNoSSI)
         rqpsptr->CacheSSI = false;
      else
      if (mrpsptr->CacheSSI)
         rqpsptr->CacheSSI = true;

      if (mrpsptr->CacheExpiresAfter)
      {
         if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_NONE)
            rqpsptr->CacheExpiresAfter = 0;
         else
            rqpsptr->CacheExpiresAfter = mrpsptr->CacheExpiresAfter;
      }
      if (mrpsptr->CacheGuardSeconds)
      {
         /* negative 1 indicates to revert to configuration maximum */
         if (mrpsptr->CacheGuardSeconds == -1)
            rqpsptr->CacheGuardSeconds = 0;
          else
            rqpsptr->CacheGuardSeconds = mrpsptr->CacheGuardSeconds;
      }
      if (mrpsptr->CacheMaxKBytes)
      {
         /* negative 1 indicates to revert to configuration maximum */
         if (mrpsptr->CacheMaxKBytes == -1)
            rqpsptr->CacheMaxKBytes = 0;
         else
            rqpsptr->CacheMaxKBytes = mrpsptr->CacheMaxKBytes;
      }
   }

   if (mrpsptr->CgiPlusInCC[0] || mrpsptr->CgiPlusInCC[1])
   {
      if (mrpsptr->CgiPlusInCC[0])
         memcpy (rqpsptr->CgiPlusInCC, mrpsptr->CgiPlusInCC,
                 sizeof(rqpsptr->CgiPlusInCC));
      else
         memset (rqpsptr->CgiPlusInCC, 0,
                 sizeof(rqpsptr->CgiPlusInCC));
   }

   if (mrpsptr->CgiPlusInNoWriteof)
      rqpsptr->CgiPlusInWriteof = false;
   else
   if (mrpsptr->CgiPlusInWriteof)
      rqpsptr->CgiPlusInWriteof = true;

   if (mrpsptr->NoDefaultSearch)
      rqpsptr->NoDefaultSearch = true;
   else
   if (mrpsptr->DefaultSearch)
      rqpsptr->NoDefaultSearch = false;

   if (mrpsptr->ClientAddress)
   {
      rqpsptr->ClientAddress = mrpsptr->ClientAddress;
      if (mrpsptr->ClientAddress == MAPURL_CLIENT_LITERAL)
      {
         rqpsptr->ClientAddressLiteralPtr =
               VmGetHeap (rqptr, mrpsptr->ClientAddressLiteralLength+1);
         memcpy (rqpsptr->ClientAddressLiteralPtr,
                 mrpsptr->ClientAddressLiteralPtr,
                 mrpsptr->ClientAddressLiteralLength+1);
      }
   }

   if (mrpsptr->DirNoAccess)
   {
      rqpsptr->DirNoAccess = true;
      rqpsptr->DirAccess = rqpsptr->DirAccessSelective = false;
   }
   else
   if (mrpsptr->DirAccess)
   {
      rqpsptr->DirAccess = true;
      rqpsptr->DirNoAccess = rqpsptr->DirAccessSelective = false;
   }
   else
   if (mrpsptr->DirAccessSelective)
   {
      rqpsptr->DirAccessSelective = true;
      rqpsptr->DirAccess = rqpsptr->DirNoAccess = false;
   }

   if (mrpsptr->DirFont == MAPURL_DIR_FONT_INHERIT)
      rqpsptr->DirFont = MAPURL_DIR_FONT_INHERIT;
   else
   if (mrpsptr->DirFont == MAPURL_DIR_FONT_MONOSPACE)
      rqpsptr->DirFont = 0;

   if (mrpsptr->DirNoIconLink)
      rqpsptr->DirNoIconLink = true;
   else
   if (mrpsptr->DirIconLink)
      rqpsptr->DirNoIconLink = false;

   if (mrpsptr->DirNoImpliedWildcard)
      rqpsptr->DirNoImpliedWildcard = true;
   else
   if (mrpsptr->DirImpliedWildcard)
      rqpsptr->DirNoImpliedWildcard = false;

   if (mrpsptr->DirSort[0])
   {
      rqpsptr->DirSort[0] = mrpsptr->DirSort[0];
      rqpsptr->DirSort[1] = mrpsptr->DirSort[1];
   }

   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_DEFAULT ||
       mrpsptr->DirStyle == MAPURL_DIR_STYLE_ANCHOR)
      rqpsptr->DirStyle = 0;
   else
   if (mrpsptr->DirStyle)
      rqpsptr->DirStyle = mrpsptr->DirStyle;

   if (mrpsptr->DirTargetPtr)
   {
      /* empty string resets */
      if (mrpsptr->DirTargetLength)
      {
         rqpsptr->DirTargetPtr =
            VmGetHeap (rqptr, mrpsptr->DirTargetLength+1);
         memcpy (rqpsptr->DirTargetPtr,
                 mrpsptr->DirTargetPtr,
                 mrpsptr->DirTargetLength+1);
      }
      else
         rqpsptr->DirTargetPtr = NULL;
   }

   if (mrpsptr->DirThesePtr)
   {
      /* empty string resets */
      if (mrpsptr->DirTheseLength)
      {
         rqpsptr->DirThesePtr =
            VmGetHeap (rqptr, mrpsptr->DirTheseLength+1);
         memcpy (rqpsptr->DirThesePtr,
                 mrpsptr->DirThesePtr,
                 mrpsptr->DirTheseLength+1);
      }
      else
         rqpsptr->DirThesePtr = NULL;
   }

   if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_THIS)
   {
      /* empty string resets */
      if (mrpsptr->DirTitleLength)
      {
         rqpsptr->DirTitle = mrpsptr->DirTitle;
         rqpsptr->DirTitlePtr =
            VmGetHeap (rqptr, mrpsptr->DirTitleLength+1);
         memcpy (rqpsptr->DirTitlePtr,
                 mrpsptr->DirTitlePtr,
                 mrpsptr->DirTitleLength+1);
      }
      else
      {
         rqpsptr->DirTitle = 0;
         rqpsptr->DirTitlePtr = NULL;
      }
   }
   else
   if (mrpsptr->DirTitle)
      rqpsptr->DirTitle = mrpsptr->DirTitle;

   if (mrpsptr->DirNoWildcard)
   {
      rqpsptr->DirNoWildcard = true;
      rqpsptr->DirWildcard = false;
   }
   else
   if (mrpsptr->DirWildcard)
   {
      rqpsptr->DirNoWildcard = false;
      rqpsptr->DirWildcard = true;
   }

   /* negative 1 indicates to revert to zero */
   if (mrpsptr->DirVersionsOf)
      rqpsptr->DirVersionsOf = mrpsptr->DirVersionsOf;

   if (mrpsptr->DirNoWildcard)
   {
      rqpsptr->DirNoWildcard = true;
      rqpsptr->DirWildcard = false;
   }
   else
   if (mrpsptr->DirWildcard)
   {
      rqpsptr->DirNoWildcard = false;
      rqpsptr->DirWildcard = true;
   }

   if (mrpsptr->NoExpired)
      rqpsptr->Expired = false;
   else
   if (mrpsptr->Expired)
      rqpsptr->Expired = true;

   if (mrpsptr->NoHtmlEquals)
   {
      rqpsptr->HtmlBodyTagPtr =
         rqpsptr->HtmlFooterPtr =
         rqpsptr->HtmlFooterTagPtr =
         rqpsptr->HtmlHeaderPtr =
         rqpsptr->HtmlHeaderTagPtr = NULL;
   }
   if (mrpsptr->HtmlBodyTagPtr)
   {
      /* empty string resets */
      if (mrpsptr->HtmlBodyTagLength)
      {
         rqpsptr->HtmlBodyTagPtr =
            VmGetHeap (rqptr, mrpsptr->HtmlBodyTagLength+1);
         memcpy (rqpsptr->HtmlBodyTagPtr,
                 mrpsptr->HtmlBodyTagPtr,
                 mrpsptr->HtmlBodyTagLength+1);
      }
      else
         rqpsptr->HtmlBodyTagPtr = NULL;
   }
   if (mrpsptr->HtmlFooterPtr)
   {
      /* empty string resets */
      if (mrpsptr->HtmlFooterLength)
      {
         rqpsptr->HtmlFooterPtr =
            VmGetHeap (rqptr, mrpsptr->HtmlFooterLength+1);
         memcpy (rqpsptr->HtmlFooterPtr,
                 mrpsptr->HtmlFooterPtr,
                 mrpsptr->HtmlFooterLength+1);
      }
      else
         rqpsptr->HtmlFooterPtr = NULL;
   }
   if (mrpsptr->HtmlFooterTagPtr)
   {
      /* empty string resets */
      if (mrpsptr->HtmlFooterTagLength)
      {
         rqpsptr->HtmlFooterTagPtr =
            VmGetHeap (rqptr, mrpsptr->HtmlFooterTagLength+1);
         memcpy (rqpsptr->HtmlFooterTagPtr,
                 mrpsptr->HtmlFooterTagPtr,
                 mrpsptr->HtmlFooterTagLength+1);
      }
      else
         rqpsptr->HtmlFooterTagPtr = NULL;
   }
   if (mrpsptr->HtmlHeaderPtr)
   {
      /* empty string resets */
      if (mrpsptr->HtmlHeaderLength)
      {
         rqpsptr->HtmlHeaderPtr =
            VmGetHeap (rqptr, mrpsptr->HtmlHeaderLength+1);
         memcpy (rqpsptr->HtmlHeaderPtr,
                 mrpsptr->HtmlHeaderPtr,
                 mrpsptr->HtmlHeaderLength+1);
      }
      else
         rqpsptr->HtmlHeaderPtr = NULL;
   }
   if (mrpsptr->HtmlHeaderTagPtr)
   {
      /* empty string resets */
      if (mrpsptr->HtmlHeaderTagLength)
      {
         rqpsptr->HtmlHeaderTagPtr =
            VmGetHeap (rqptr, mrpsptr->HtmlHeaderTagLength+1);
         memcpy (rqpsptr->HtmlHeaderTagPtr,
                 mrpsptr->HtmlHeaderTagPtr,
                 mrpsptr->HtmlHeaderTagLength+1);
      }
      else
         rqpsptr->HtmlHeaderTagPtr = NULL;
   }

   if (HTTP2_REQUEST(rqptr))
   {
      /* if HTTP/2 request */
      if (mrpsptr->Http2MaxStreams)
         rqpsptr->Http2MaxStreams = mrpsptr->Http2MaxStreams;
      if (mrpsptr->Http2SendGoAway)
         rqpsptr->Http2SendGoAway = mrpsptr->Http2SendGoAway;
      if (mrpsptr->Http2SendPing) rqpsptr->Http2SendPing = true;
      if (mrpsptr->Http2SendReset)
         rqpsptr->Http2SendReset = mrpsptr->Http2SendReset;
      if (mrpsptr->Http2ToHttp11) rqpsptr->Http2ToHttp11 = true;
      if (mrpsptr->Http2WriteQueue)
         rqpsptr->Http2WriteQueue = mrpsptr->Http2WriteQueue;
   }

   if (mrpsptr->NoLog)
      rqpsptr->NoLog = true;
   else
   if (mrpsptr->Log)
      rqpsptr->NoLog = false;

   if (mrpsptr->MapNonEmpty)
      rqpsptr->MapEmpty = false;
   else
   if (mrpsptr->MapEmpty)
      rqpsptr->MapEmpty = true;

   if (mrpsptr->MapExtensionMethod)
      rqpsptr->MapExtensionMethod = true;
   else
   if (mrpsptr->MapExtensionMethod)
      rqpsptr->MapExtensionMethod = false;

   if (mrpsptr->MapOnce)
      rqpsptr->MapOnce = true;
   else
   if (mrpsptr->NoMapOnce)
      rqpsptr->MapOnce = false;

   if (mrpsptr->MapUri) rqpsptr->MapUri = true;

   if (mrpsptr->PrivSsi)
      rqpsptr->PrivSsi = true;
   else
   if (mrpsptr->NoPrivSsi)
      rqpsptr->PrivSsi = false;

   if (mrpsptr->NoProfile)
      rqpsptr->NoProfile = true;
   else
   if (mrpsptr->Profile)
      rqpsptr->NoProfile = false;

   if (mrpsptr->ProxyNoAffinity)
      rqpsptr->ProxyAffinity = false;
   else
   if (mrpsptr->ProxyAffinity)
      rqpsptr->ProxyAffinity = true;

   if (mrpsptr->ProxyForwardedBy)
      rqpsptr->ProxyForwardedBy = mrpsptr->ProxyForwardedBy;

   if (mrpsptr->ProxyXForwardedFor)
      rqpsptr->ProxyXForwardedFor = mrpsptr->ProxyXForwardedFor;

   if (mrpsptr->NoProxyReverseVerify)
      rqpsptr->ProxyReverseVerify = false;
   else
   if (mrpsptr->ProxyReverseVerify)
      rqpsptr->ProxyReverseVerify = true;

   if (mrpsptr->NoProxyReverseAuthHeader)
      rqpsptr->ProxyReverseNoAuthHeader = true;
   else
   if (mrpsptr->ProxyReverseAuthHeader)
      rqpsptr->ProxyReverseNoAuthHeader = false;

   if (mrpsptr->ProxyTunnelRequestLength)
   {
      rqpsptr->ProxyTunnelRequestPtr =
         VmGetHeap (rqptr, mrpsptr->ProxyTunnelRequestLength);
      memcpy (rqpsptr->ProxyTunnelRequestPtr,
              mrpsptr->ProxyTunnelRequestPtr,
              mrpsptr->ProxyTunnelRequestLength);
      rqpsptr->ProxyTunnelRequestLength = mrpsptr->ProxyTunnelRequestLength;
   }

   if (mrpsptr->NoProxyUnknownRequestFields)
      rqpsptr->ProxyUnknownRequestFields = false;
   else
   if (mrpsptr->ProxyUnknownRequestFields)
      rqpsptr->ProxyUnknownRequestFields = true;

   if (mrpsptr->ProxyHeaderCount)
   {
      rqpsptr->ProxyHeaderCount = mrpsptr->ProxyHeaderCount;
      for (int idx = 0; idx < mrpsptr->ProxyHeaderCount; idx++)
      {
         rqpsptr->ProxyHeader[idx] =
            VmGetHeap (rqptr, size = strlen(mrpsptr->ProxyHeader[idx])+1);
         strzcpy (rqpsptr->ProxyHeader[idx], mrpsptr->ProxyHeader[idx], size);
      }
   }

   if (mrpsptr->PutRFM) rqpsptr->PutRFM = mrpsptr->PutRFM; 

   if (mrpsptr->PutMaxKbytes) rqpsptr->PutMaxKbytes = mrpsptr->PutMaxKbytes; 

   if (mrpsptr->RegexSyntax)
      if ((rqpsptr->RegexSyntax = mrpsptr->RegexSyntax) == -1)
         rqpsptr->RegexSyntax = 0;

   if (mrpsptr->ReportType) rqpsptr->ReportType = mrpsptr->ReportType;

   if (mrpsptr->Report400as)
      rqpsptr->Report400as = mrpsptr->Report400as;
   if (mrpsptr->Report403as)
      rqpsptr->Report403as = mrpsptr->Report403as;
   if (mrpsptr->Report404as)
      rqpsptr->Report404as = mrpsptr->Report404as;

   if (mrpsptr->ResponseGzip)
      rqpsptr->ResponseGzip = mrpsptr->ResponseGzip;

   if (mrpsptr->Response200is203)
      rqpsptr->Response200is203 = mrpsptr->Response200is203;

   if (mrpsptr->ResponseNoChunked)
      rqpsptr->ResponseNoChunked = true;
   else
   if (mrpsptr->ResponseChunked)
      rqpsptr->ResponseChunked = true;

   if (mrpsptr->ResponseHeaderNone)
      rqpsptr->ResponseHeaderNone = true;
   else
   if (mrpsptr->ResponseHeaderBegin)
      rqpsptr->ResponseHeaderBegin = true;
   else
   if (mrpsptr->ResponseHeaderFull)
      rqpsptr->ResponseHeaderBegin =
         rqpsptr->ResponseHeaderNone = false;

   if (mrpsptr->ResponseHttpNoOriginal)
      rqpsptr->ResponseHttpOriginal = false;
   else
   if (mrpsptr->ResponseHttpOriginal)
      rqpsptr->ResponseHttpOriginal = true;

   if (mrpsptr->ScriptBodyNoDecode)
      rqpsptr->ScriptBodyDecode = false;
   else
   if (mrpsptr->ScriptBodyDecode)
      rqpsptr->ScriptBodyDecode = true;

   if (mrpsptr->ScriptSymbolNoTruncate)
      rqpsptr->ScriptSymbolTruncate = false;
   else
   if (mrpsptr->ScriptSymbolTruncate)
      rqpsptr->ScriptSymbolTruncate = true;

   if (mrpsptr->ScriptSyntaxNoUnix)
      rqpsptr->ScriptSyntaxUnix = false;
   else
   if (mrpsptr->ScriptSyntaxUnix)
      rqpsptr->ScriptSyntaxUnix = true;

   /* careful! this one's a little back-to-front */
   if (mrpsptr->ScriptFind)
      rqpsptr->ScriptNoFind = false;
   else
   if (mrpsptr->ScriptNoFind)
      rqpsptr->ScriptNoFind = true;

   if (mrpsptr->ScriptNoPathFind)
      rqpsptr->ScriptPathFind = false;
   else
   if (mrpsptr->ScriptPathFind)
      rqpsptr->ScriptPathFind = true;

   if (mrpsptr->ScriptNoQueryNone)
      rqpsptr->ScriptQueryNone = false;
   else
   if (mrpsptr->ScriptQueryNone)
      rqpsptr->ScriptQueryNone = true;

   if (mrpsptr->ScriptNoQueryRelaxed)
      rqpsptr->ScriptQueryRelaxed = false;
   else
   if (mrpsptr->ScriptQueryRelaxed)
      rqpsptr->ScriptQueryRelaxed = true;

   if (mrpsptr->AccessNoProfile)
      rqpsptr->AccessProfile = false;
   else
   if (mrpsptr->AccessProfile)
      rqpsptr->AccessProfile = true;

   if (mrpsptr->AccessNoRead)
      rqpsptr->AccessRead = false;
   else
   if (mrpsptr->AccessRead)
      rqpsptr->AccessRead = true;

   if (mrpsptr->AccessNoServer)
      rqpsptr->AccessServer = false;
   else
   if (mrpsptr->AccessServer)
      rqpsptr->AccessServer = true;

   if (mrpsptr->AccessNoWrite)
      rqpsptr->AccessWrite = false;
   else
   if (mrpsptr->AccessWrite)
      rqpsptr->AccessWrite = true;

   if (mrpsptr->WebDavNoAll)
      rqpsptr->WebDavAll = false;
   else
   if (mrpsptr->WebDavAll)
      rqpsptr->WebDavAll = true;

   if (mrpsptr->WebDavNoAuth)
      rqpsptr->WebDavAuth = false;
   else
   if (mrpsptr->WebDavAuth)
      rqpsptr->WebDavAuth = true;

   if (mrpsptr->WebDavNoHidden)
      rqpsptr->WebDavNoHidden = true;
   else
   if (mrpsptr->WebDavHidden)
      rqpsptr->WebDavNoHidden = false;

   if (mrpsptr->WebDavNoLock)
      rqpsptr->WebDavNoLock = true;
   else
   if (mrpsptr->WebDavLock)
      rqpsptr->WebDavNoLock = false;

   /* allowed to be an empty string (suppresses directory) */
   if (mrpsptr->WebDavMetaDirPtr)
   {
      rqpsptr->WebDavMetaDirPtr =
         VmGetHeap (rqptr, mrpsptr->WebDavMetaDirLength+1);
      memcpy (rqpsptr->WebDavMetaDirPtr,
              mrpsptr->WebDavMetaDirPtr,
              mrpsptr->WebDavMetaDirLength+1);
   }

   if (mrpsptr->WebDavNoProfile)
      rqpsptr->WebDavProfile = false;
   else
   if (mrpsptr->WebDavProfile)
      rqpsptr->WebDavProfile = true;

   if (mrpsptr->WebDavNoProp)
      rqpsptr->WebDavNoProp = true;
   else
   if (mrpsptr->WebDavProp)
      rqpsptr->WebDavNoProp = false;

   if (mrpsptr->WebDavNoPutLock)
      rqpsptr->WebDavPutLock = false;
   else
   if (mrpsptr->WebDavPutLock)
      rqpsptr->WebDavPutLock = true;

   if (mrpsptr->WebDavNoRead)
      rqpsptr->WebDavRead = false;
   else
   if (mrpsptr->WebDavRead)
      rqpsptr->WebDavRead = true;

   if (mrpsptr->WebDavNoServer)
      rqpsptr->WebDavServer = false;
   else
   if (mrpsptr->WebDavServer)
      rqpsptr->WebDavServer = true;

   if (mrpsptr->WebDavNoWinProp)
      rqpsptr->WebDavNoWinProp = true;
   else
   if (mrpsptr->WebDavWinProp)
      rqpsptr->WebDavNoWinProp = false;

   if (mrpsptr->WebDavNoWrite)
      rqpsptr->WebDavWrite = false;
   else
   if (mrpsptr->WebDavWrite)
      rqpsptr->WebDavWrite = true;

   if (mrpsptr->WebDavLockTimeoutDefault)
      rqpsptr->WebDavLockTimeoutDefault = mrpsptr->WebDavLockTimeoutDefault;

   if (mrpsptr->WebDavLockTimeoutMax)
      rqpsptr->WebDavLockTimeoutMax = mrpsptr->WebDavLockTimeoutMax;

   if (mrpsptr->WebSocketInputSize)
      rqpsptr->WebSocketInputSize = mrpsptr->WebSocketInputSize;

   if (mrpsptr->WebSocketOutputSize)
      rqpsptr->WebSocketOutputSize = mrpsptr->WebSocketOutputSize;

   if (rqpsptr->ThrottleSet &&
       mrpsptr->ThrottleNoSet)
   {
      /* reset a previously mapped throttle */
      rqpsptr->ThrottleSet = false;
      rqpsptr->ThrottleBusy =
         rqpsptr->ThrottleFrom =
         rqpsptr->ThrottleIndex =
         rqpsptr->ThrottlePerUser = 
         rqpsptr->ThrottleResume =
         rqpsptr->ThrottleTo =
         rqpsptr->ThrottleTimeoutBusy =
         rqpsptr->ThrottleTimeoutQueue = 0;
   }
   else
   if (!rqpsptr->ThrottleSet &&
       mrpsptr->ThrottleSet)
   {
      /* only if it hasn't been set in any previous pass */
      rqpsptr->ThrottleSet = true;
      rqpsptr->ThrottleBusy = mrpsptr->ThrottleBusy;
      rqpsptr->ThrottleFrom = mrpsptr->ThrottleFrom;
      rqpsptr->ThrottleIndex = mrpsptr->ThrottleIndex;
      rqpsptr->ThrottlePerUser = mrpsptr->ThrottlePerUser;
      rqpsptr->ThrottleResume = mrpsptr->ThrottleResume;
      rqpsptr->ThrottleTo = mrpsptr->ThrottleTo;
      rqpsptr->ThrottleTimeoutBusy = mrpsptr->ThrottleTimeoutBusy;
      rqpsptr->ThrottleTimeoutQueue = mrpsptr->ThrottleTimeoutQueue;
   }

   /* only if they haven't been set in any previous pass */
   if (!rqpsptr->ScriptBitBucketTimeout)
      rqpsptr->ScriptBitBucketTimeout = mrpsptr->ScriptBitBucketTimeout;

   if (!rqpsptr->ScriptCpuMax)
      rqpsptr->ScriptCpuMax = mrpsptr->ScriptCpuMax;

   if (!rqpsptr->ScriptLifeTime)
      rqpsptr->ScriptLifeTime = mrpsptr->ScriptLifeTime;

   /* hmmm, bit of a kludge (but easy) */
   if (mrpsptr->TimeoutPersistent < 0)
      rqptr->PersistentRequest = false;
   else
      rqpsptr->TimeoutPersistent = mrpsptr->TimeoutPersistent;

   if (!rqpsptr->TimeoutNoProgress)
      rqpsptr->TimeoutNoProgress = mrpsptr->TimeoutNoProgress;

   if (!rqpsptr->TimeoutOutput)
      rqpsptr->TimeoutOutput = mrpsptr->TimeoutOutput;

   if (mrpsptr->NoStmLF)
      rqpsptr->StmLF = false;
   else
   if (mrpsptr->StmLF)
      rqpsptr->StmLF = true;

   if (mrpsptr->SSLCGIvar)
   {
      if (rqpsptr->SSLCGIvar == SESOLA_CGI_VAR_NONE)
         rqpsptr->SSLCGIvar = 0;
      else
         rqpsptr->SSLCGIvar = mrpsptr->SSLCGIvar;
   }

   if (mrpsptr->PathOds) rqpsptr->PathOds = mrpsptr->PathOds;

   if (mrpsptr->OdsName)
      if (mrpsptr->OdsName == MAPURL_ODS_DEFAULT)
         rqpsptr->OdsName = 0;
      else
         rqpsptr->OdsName = mrpsptr->OdsName;
 
   /* allowed to be an empty string */
   if (mrpsptr->CgiPrefixPtr)
   {
      rqpsptr->CgiPrefixPtr =
         VmGetHeap (rqptr, mrpsptr->CgiPrefixLength+1);
      memcpy (rqpsptr->CgiPrefixPtr,
              mrpsptr->CgiPrefixPtr,
              mrpsptr->CgiPrefixLength+1);
   }

   /* allowed to be an empty string (suppresses charset) */
   if (mrpsptr->CharsetPtr)
   {
      rqpsptr->CharsetPtr =
         VmGetHeap (rqptr, mrpsptr->CharsetLength+1);
      memcpy (rqpsptr->CharsetPtr,
              mrpsptr->CharsetPtr,
              mrpsptr->CharsetLength+1);
   }

   /* empty string resets (reverts type, must have a content type) */
   if (mrpsptr->ContentTypePtr)
   {
      if (mrpsptr->ContentTypeLength)
      {
         rqpsptr->ContentTypePtr =
            VmGetHeap (rqptr, mrpsptr->ContentTypeLength+1);
         memcpy (rqpsptr->ContentTypePtr,
                 mrpsptr->ContentTypePtr,
                 mrpsptr->ContentTypeLength+1);
      }
      else
         rqpsptr->ContentTypePtr = NULL;
   }

   /* allowed to be an empty string (suppresses charset) */
   if (mrpsptr->DirCharsetPtr)
   {
      rqpsptr->DirCharsetPtr =
         VmGetHeap (rqptr, mrpsptr->DirCharsetLength+1);
      memcpy (rqpsptr->DirCharsetPtr,
              mrpsptr->DirCharsetPtr,
              mrpsptr->DirCharsetLength+1);
   }

   if (mrpsptr->CgiVarPtr)
   {
      MetaConDictionary (rqptr, mrpsptr->CgiVarPtr);
      if (WATCHPNT(rqptr) && (WATCH_CATEGORY(WATCH_MAPPING) &&
                              WATCH_CATEGORY(WATCH_INTERNAL)))
         DictWatch (rqptr->rqDictPtr, DICT_TYPE_CONFIG, "*");
   }

   /* allowed to be an empty string */
   if (mrpsptr->HttpAcceptCharsetPtr)
   {
      if (mrpsptr->HttpAcceptCharsetPtr[0])
      {
         rqptr->rqHeader.AcceptCharsetPtr =
            VmGetHeap (rqptr, mrpsptr->HttpAcceptCharsetLength+1);
         memcpy (rqptr->rqHeader.AcceptCharsetPtr,
                 mrpsptr->HttpAcceptCharsetPtr,
                 mrpsptr->HttpAcceptCharsetLength+1);
      }
      else
      {
         /* empty, as if it had never been part of the request header */
         rqptr->rqHeader.AcceptCharsetPtr = NULL;
      }
   }

   /* allowed to be an empty string */
   if (mrpsptr->HttpAcceptLangPtr)
   {
      if (mrpsptr->HttpAcceptLangPtr[0])
      {
         rqptr->rqHeader.AcceptLangPtr =
            VmGetHeap (rqptr, mrpsptr->HttpAcceptLangLength+1);
         memcpy (rqptr->rqHeader.AcceptLangPtr,
                 mrpsptr->HttpAcceptLangPtr,
                 mrpsptr->HttpAcceptLangLength+1);
      }
      else
      {
         /* empty, as if it had never been part of the request header */
         rqptr->rqHeader.AcceptLangPtr = NULL;
      }
   }

   if (mrpsptr->IndexPtr)
   {
      /* empty string resets */
      if (mrpsptr->IndexLength)
      {
         rqpsptr->IndexPtr =
            VmGetHeap (rqptr, mrpsptr->IndexLength+1);
         memcpy (rqpsptr->IndexPtr,
                 mrpsptr->IndexPtr,
                 mrpsptr->IndexLength+1);
      }
      else
         rqpsptr->IndexPtr = NULL;
   }

   if (mrpsptr->DictionaryPtr)
   {
      MetaConDictionary (rqptr, mrpsptr->DictionaryPtr);
      if (WATCHPNT(rqptr) && (WATCH_CATEGORY(WATCH_MAPPING) &&
                              WATCH_CATEGORY(WATCH_INTERNAL)))
         DictWatch (rqptr->rqDictPtr, DICT_TYPE_CONFIG, "*");
   }

   if (mrpsptr->NotePadPtr)
   {
      if (WATCHING (rqptr, WATCH_MAPPING))
      {
         MetaConNotePad (rqptr, mrpsptr->NotePadPtr, true);
         WatchThis (WATCHITM(rqptr), WATCH_MAPPING, "NOTEPAD !AZ",
                    rqptr->NotePadPtr != NULL ? rqptr->NotePadPtr : "(empty)");
      }
      else
         MetaConNotePad (rqptr, mrpsptr->NotePadPtr, false);
   }

   if (mrpsptr->ProxyReverseLocationPtr)
   {
      /* empty string resets */
      if (mrpsptr->ProxyReverseLocationLength)
      {
         rqpsptr->ProxyReverseLocationPtr =
            VmGetHeap (rqptr, mrpsptr->ProxyReverseLocationLength+1);
         memcpy (rqpsptr->ProxyReverseLocationPtr,
                 mrpsptr->ProxyReverseLocationPtr,
                 mrpsptr->ProxyReverseLocationLength+1);
      }
      else
         rqpsptr->ProxyReverseLocationPtr = NULL;
   }

   if (mrpsptr->ProxyReworkPtr)
   {
      /* empty string resets */
      if (mrpsptr->ProxyReworkLength)
      {
         rqpsptr->ProxyReworkPtr =
            VmGetHeap (rqptr, mrpsptr->ProxyReworkLength+1);
         memcpy (rqpsptr->ProxyReworkPtr,
                 mrpsptr->ProxyReworkPtr,
                 mrpsptr->ProxyReworkLength+1);
      }
      else
         rqpsptr->ProxyReworkPtr = NULL;
   }

   /* query string is allowed to be set empty */
   if (mrpsptr->QueryStringPtr)
   {
      if (rqptr->rqHeader.QueryStringLength < mrpsptr->QueryStringLength)
         rqptr->rqHeader.QueryStringPtr =
            VmGetHeap (rqptr, mrpsptr->QueryStringLength+1);
      memcpy (rqptr->rqHeader.QueryStringPtr,
              mrpsptr->QueryStringPtr,
              mrpsptr->QueryStringLength+1);
      rqptr->rqHeader.QueryStringLength = mrpsptr->QueryStringLength;
   }

   /* also see DCL callout "CSP:" */
   if (mrpsptr->ResponseCspLength < 0)
   {
      rqpsptr->ResponseCspPtr = NULL;
      rqpsptr->ResponseCspLength = 0;
   }
   else
   if (length = mrpsptr->ResponseCspLength)
   {
      cptr = mrpsptr->ResponseCspPtr;
      rqpsptr->ResponseCspPtr = sptr =
         VmReallocHeap (rqptr, rqpsptr->ResponseCspPtr,
                        rqpsptr->ResponseCspLength + length+2, FI_LI);
      if (rqpsptr->ResponseCspLength)
      {
         sptr += rqpsptr->ResponseCspLength;
         *sptr++ = ' ';
      }
      memcpy (sptr, cptr, length);
      sptr += length;
      rqpsptr->ResponseCspLength = sptr - rqpsptr->ResponseCspPtr;
   }

   /* also see DCL callout "CSPRO:" */
   if (mrpsptr->ResponseCsproLength < 0)
   {
      rqpsptr->ResponseCsproPtr = NULL;
      rqpsptr->ResponseCsproLength = 0;
   }
   else
   if (length = mrpsptr->ResponseCsproLength)
   {
      cptr = mrpsptr->ResponseCsproPtr;
      rqpsptr->ResponseCsproPtr = sptr =
         VmReallocHeap (rqptr, rqpsptr->ResponseCsproPtr,
                        rqpsptr->ResponseCsproLength + length+2, FI_LI);
      if (rqpsptr->ResponseCsproLength)
      {
         sptr += rqpsptr->ResponseCsproLength;
         *sptr++ = ' ';
      }
      memcpy (sptr, cptr, length);
      sptr += length;
      rqpsptr->ResponseCsproLength = sptr - rqpsptr->ResponseCsproPtr;
   }

   /* leave this in for backward compatibility (but use empty string) */
   if (mrpsptr->ResponseHeaderNoAdd)
   {
      rqpsptr->ResponseHeaderAddPtr = NULL;
      rqpsptr->ResponseHeaderAddLength = 0;
   }

   if (mrpsptr->ResponseHeaderAddPtr &&
       !mrpsptr->ResponseHeaderAddLength)
   {
      /* empty string resets */
      rqpsptr->ResponseHeaderAddPtr = NULL;
      rqpsptr->ResponseHeaderAddLength = 0;
   }
   else
   if (length = mrpsptr->ResponseHeaderAddLength)
   {
      cptr = mrpsptr->ResponseHeaderAddPtr;
      rqpsptr->ResponseHeaderAddPtr = sptr =
         VmReallocHeap (rqptr, rqpsptr->ResponseHeaderAddPtr,
                        rqpsptr->ResponseHeaderAddLength +
                        mrpsptr->ResponseHeaderAddLength+2, FI_LI);
      sptr += rqpsptr->ResponseHeaderAddLength;
      memcpy (sptr, cptr, length);
      sptr += length;
      SET2(sptr,'\n\0');
      sptr++;
      rqpsptr->ResponseHeaderAddLength = sptr - rqpsptr->ResponseHeaderAddPtr;
   }

   if (mrpsptr->ResponseVarRecord)
   {
      if (mrpsptr->ResponseVarRecord == FILE_VAR_DEFAULT)
         rqpsptr->ResponseVarRecord = 0;
      else
         rqpsptr->ResponseVarRecord = mrpsptr->ResponseVarRecord;
   }

   if (mrpsptr->ResponseStrictTransSecPtr)
   {
      /* must start with an integer or suppresses header */
      if (mrpsptr->ResponseStrictTransSecLength)
      {
         rqpsptr->ResponseStrictTransSecPtr =
            VmGetHeap (rqptr, mrpsptr->ResponseStrictTransSecLength+1);
         memcpy (rqpsptr->ResponseStrictTransSecPtr,
                 mrpsptr->ResponseStrictTransSecPtr,
                 mrpsptr->ResponseStrictTransSecLength+1);
      }
      else
         rqpsptr->ResponseStrictTransSecPtr = NULL;
   }

   if (mrpsptr->ScriptCommandPtr)
   {
      /* empty string resets */
      if (mrpsptr->ScriptCommandLength)
      {
         rqpsptr->ScriptCommandPtr =
            VmGetHeap (rqptr, mrpsptr->ScriptCommandLength+1);
         memcpy (rqpsptr->ScriptCommandPtr,
                 mrpsptr->ScriptCommandPtr,
                 mrpsptr->ScriptCommandLength+1);
      }
      else
         rqpsptr->ScriptCommandPtr = NULL;
   }

   if (mrpsptr->ScriptControlPtr)
   {
      /* empty string resets */
      if (mrpsptr->ScriptControlLength)
      {
         rqpsptr->ScriptControlPtr =
            VmGetHeap (rqptr, mrpsptr->ScriptControlLength+1);
         memcpy (rqpsptr->ScriptControlPtr,
                 mrpsptr->ScriptControlPtr,
                 mrpsptr->ScriptControlLength+1);
      }
      else
         rqpsptr->ScriptControlPtr = NULL;
   }

   if (mrpsptr->ScriptDefaultPtr)
   {
      /* empty string resets */
      if (mrpsptr->ScriptDefaultLength)
      {
         rqpsptr->ScriptDefaultPtr =
            VmGetHeap (rqptr, mrpsptr->ScriptDefaultLength+1);
         memcpy (rqpsptr->ScriptDefaultPtr,
                 mrpsptr->ScriptDefaultPtr,
                 mrpsptr->ScriptDefaultLength+1);
      }
      else
         rqpsptr->ScriptDefaultPtr = NULL;
   }

   if (mrpsptr->ScriptParamsPtr &&
       !mrpsptr->ScriptParamsLength)
   {
      /* empty string resets */
      mrpsptr->ScriptParamsPtr = NULL;
      mrpsptr->ScriptParamsLength = 0;
   }
   else
   if (mrpsptr->ScriptParamsPtr)
   {
      rqpsptr->ScriptParamsPtr = sptr =
         VmReallocHeap (rqptr, rqpsptr->ScriptParamsPtr,
                        rqpsptr->ScriptParamsLength +
                        mrpsptr->ScriptParamsLength+1, FI_LI);
      sptr += rqpsptr->ScriptParamsLength;
      cptr = mrpsptr->ScriptParamsPtr;
      length = mrpsptr->ScriptParamsLength;
      if (*cptr == '+')
      {
         cptr++;
         length--;
      }
      memcpy (sptr, cptr, length);
      rqpsptr->ScriptParamsLength += length;
   }

   if (mrpsptr->ChangeServicePtr)
   {
      /* empty string resets */
      if (mrpsptr->ChangeServiceLength)
      {
         rqpsptr->ChangeServicePtr =
            VmGetHeap (rqptr, mrpsptr->ChangeServiceLength+1);
         memcpy (rqpsptr->ChangeServicePtr,
                 mrpsptr->ChangeServicePtr,
                 mrpsptr->ChangeServiceLength+1);
      }
      else
         rqpsptr->ChangeServicePtr = NULL;
   }

   if (mrpsptr->SsiExecPtr)
   {
      /* empty string resets */
      if (mrpsptr->SsiExecLength)
      {
         rqpsptr->SsiExecPtr =
            VmGetHeap (rqptr, mrpsptr->SsiExecLength+1);
         memcpy (rqpsptr->SsiExecPtr,
                 mrpsptr->SsiExecPtr,
                 mrpsptr->SsiExecLength+1);
      }
      else
         rqpsptr->SsiExecPtr = NULL;
   }

   if (mrpsptr->StyleSheetPtr)
   {
      /* empty string resets */
      if (mrpsptr->StyleSheetLength)
      {
         rqpsptr->StyleSheetPtr =
            VmGetHeap (rqptr, mrpsptr->StyleSheetLength+1);
         memcpy (rqpsptr->StyleSheetPtr,
                 mrpsptr->StyleSheetPtr,
                 mrpsptr->StyleSheetLength+1);
      }
      else
         rqpsptr->StyleSheetPtr = NULL;
   }

   if (mrpsptr->CorsNoAllowCredentials)
      rqpsptr->CorsAllowCredentials = false;
   else
   if (mrpsptr->CorsAllowCredentials)
      rqpsptr->CorsAllowCredentials = true;

   if (mrpsptr->CorsAllowHeadersPtr)
   {
      /* empty string resets */
      if (mrpsptr->CorsAllowHeadersLength)
      {
         rqpsptr->CorsAllowHeadersPtr =
            VmGetHeap (rqptr, mrpsptr->CorsAllowHeadersLength+1);
         memcpy (rqpsptr->CorsAllowHeadersPtr,
                 mrpsptr->CorsAllowHeadersPtr,
                 mrpsptr->CorsAllowHeadersLength+1);
      }
      else
         rqpsptr->CorsAllowHeadersPtr = NULL;
   }

   if (mrpsptr->CorsAllowMethodsPtr)
   {
      /* empty string resets */
      if (mrpsptr->CorsAllowMethodsLength)
      {
         rqpsptr->CorsAllowMethodsPtr =
            VmGetHeap (rqptr, mrpsptr->CorsAllowMethodsLength+1);
         memcpy (rqpsptr->CorsAllowMethodsPtr,
                 mrpsptr->CorsAllowMethodsPtr,
                 mrpsptr->CorsAllowMethodsLength+1);
      }
      else
         rqpsptr->CorsAllowMethodsPtr = NULL;
   }

   if (mrpsptr->CorsAllowOriginPtr)
   {
      /* empty string resets */
      if (mrpsptr->CorsAllowOriginLength)
      {
         rqpsptr->CorsAllowOriginPtr =
            VmGetHeap (rqptr, mrpsptr->CorsAllowOriginLength+1);
         memcpy (rqpsptr->CorsAllowOriginPtr,
                 mrpsptr->CorsAllowOriginPtr,
                 mrpsptr->CorsAllowOriginLength+1);
      }
      else
         rqpsptr->CorsAllowOriginPtr = NULL;
   }

   if (mrpsptr->CorsExposeHeadersPtr)
   {
      /* empty string resets */
      if (mrpsptr->CorsExposeHeadersLength)
      {
         rqpsptr->CorsExposeHeadersPtr =
            VmGetHeap (rqptr, mrpsptr->CorsExposeHeadersLength+1);
         memcpy (rqpsptr->CorsExposeHeadersPtr,
                 mrpsptr->CorsExposeHeadersPtr,
                 mrpsptr->CorsExposeHeadersLength+1);
      }
      else
         rqpsptr->CorsExposeHeadersPtr = NULL;
   }

   if (mrpsptr->CorsMaxAge)
   {
      /* negative 1 indicates to revert to configuration maximum */
      if (mrpsptr->CorsMaxAge == -1)
         rqpsptr->CorsMaxAge = 0;
      else
         rqpsptr->CorsMaxAge = mrpsptr->CorsMaxAge;
   }

   if (IPADDRESS_IS_RESET(&rqpsptr->ProxyBindIpAddress) &&
       IPADDRESS_IS_SET(&mrpsptr->ProxyBindIpAddress))
      rqpsptr->ProxyBindIpAddress = mrpsptr->ProxyBindIpAddress;

   if (IPADDRESS_IS_RESET(&rqpsptr->ProxyChainIpAddress) &&
       IPADDRESS_IS_SET(&mrpsptr->ProxyChainIpAddress))
   {
      IPADDRESS_COPY (&rqpsptr->ProxyChainIpAddress,
                      &mrpsptr->ProxyChainIpAddress);
      rqpsptr->ProxyChainPort = mrpsptr->ProxyChainPort;
      if (mrpsptr->ProxyChainHostPortPtr &&
          mrpsptr->ProxyChainHostPortPtr[0])
      {
         rqpsptr->ProxyChainHostPortPtr =
            VmGetHeap (rqptr, mrpsptr->ProxyChainHostPortLength+1);
         memcpy (rqpsptr->ProxyChainHostPortPtr,
                 mrpsptr->ProxyChainHostPortPtr,
                 mrpsptr->ProxyChainHostPortLength+1);
      }
   }

   if (mrpsptr->ProxyChainCredPtr)
   {
      /* empty string resets */
      if (mrpsptr->ProxyChainCredLength)
      {
         rqpsptr->ProxyChainCredPtr =
            VmGetHeap (rqptr, mrpsptr->ProxyChainCredLength+1);
         memcpy (rqpsptr->ProxyChainCredPtr,
                 mrpsptr->ProxyChainCredPtr,
                 mrpsptr->ProxyChainCredLength+1);
      }
      else
         rqpsptr->ProxyChainCredPtr = NULL;
   }
}

/*****************************************************************************/
/*
Display mapping rules used to resolve the path in the query string.  Called
from the Request.c modules.  For HTTP report, uses blocking network write.
There are a number of intermediate FaolToBuffer()s.  This was done only to make
the format strings a bit easier to manage.
*/

char* MapSetExplain
(
REQUEST_STRUCT *rqptr,
MAP_RULE_META *mrptr
)
{
   static char  Buffer [MAP_BUFFER_SIZE];

   int  blen, size, status;
   unsigned short  slen;
   unsigned long  FaoVector [32];
   unsigned long  *vecptr;
   char  *bptr;
   char  FaoString [1024],
         RegexNumString [32];
   MAP_SET_META  *mrpsptr;

   /*********/
   /* begin */
   /*********/

   if (WATCHMOD (rqptr, WATCH_MOD_MAPURL))
      WatchThis (WATCHITM(rqptr), WATCH_MOD_MAPURL, "MapSetExplain()");

   bptr = Buffer;
   blen = sizeof(Buffer);
   mrpsptr = &mrptr->mpPathSet;

   vecptr = FaoVector;
   FaoString[0] = 0;
   size = sizeof(FaoString);

   if (mrpsptr->NoAcceptLang)
      strzcat (FaoString, " NOaccept=LANG", size);
   else
   if (mrpsptr->AcceptLangChar)
   {
      strzcat (FaoString, " accept=LANG=(default=!AZ,char=!&C,!&?type\rname\r)", size);
      if (mrpsptr->AcceptLangPtr)
         *vecptr++ = mrpsptr->AcceptLangPtr;
      else
         *vecptr++ = "";
      *vecptr++ = mrpsptr->AcceptLangChar;
      *vecptr++ = mrpsptr->AcceptLangTypeVariant;
   }

   if (mrpsptr->NoAlert)
      strzcat (FaoString, " NOALERT", size);
   else
   if (mrpsptr->Alert == MAPURL_PATH_ALERT_END)
      strzcat (FaoString, " ALERT=end", size);
   else
   if (mrpsptr->Alert == MAPURL_PATH_ALERT_AUTH)
      strzcat (FaoString, " ALERT=auth", size);
   else
   if (mrpsptr->Alert == MAPURL_PATH_ALERT_MAP)
      strzcat (FaoString, " ALERT=map", size);
   else
   if (mrpsptr->Alert)
   {
      strzcat (FaoString, " ALERT=!UL", size);
      *vecptr++ = mrpsptr->Alert;
   }

   if (mrpsptr->NoAuthAll)
      strzcat (FaoString, " NOauth=ALL", size);
   else
   if (mrpsptr->AuthAll)
      strzcat (FaoString, " auth=ALL", size);

   if (mrpsptr->NoAuthMapped)
      strzcat (FaoString, " NOauth=MAPPED", size);
   else
   if (mrpsptr->AuthMapped)
      strzcat (FaoString, " auth=MAPPED", size);

   if (mrpsptr->NoAuthOnce)
      strzcat (FaoString, " NOauth=ONCE", size);
   else
   if (mrpsptr->AuthOnce)
      strzcat (FaoString, " auth=ONCE", size);

   if (mrpsptr->AuthSysUafPwdExpUrlPtr)
   {
      strzcat (FaoString, " auth=SYSUAF=pwdexpURL=!&\"AZ", size);
      *vecptr++ = mrpsptr->AuthSysUafPwdExpUrlPtr;
   }

   if (mrpsptr->AuthRevalidateTimeout)
   {
      strzcat (FaoString, " auth=REVALIDATE=!AZ", size);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->AuthRevalidateTimeout);
   }

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
      bptr += slen;
      blen -= slen;
      vecptr = FaoVector;
      FaoString[0] = 0;
   }

   if (mrpsptr->NoCache)
      strzcat (FaoString, " NOcache", size);
   else
   if (mrpsptr->Cache)
      strzcat (FaoString, " cache", size);

   if (mrpsptr->CacheNoCGI)
      strzcat (FaoString, " cache=noCGI", size);
   else
   if (mrpsptr->CacheCGI)
      strzcat (FaoString, " cache=CGI", size);

   if (mrpsptr->CacheNoCookie)
      strzcat (FaoString, " cache=nocookie", size);
   else
   if (mrpsptr->CacheCookie)
      strzcat (FaoString, " cache=cookie", size);

   if (mrpsptr->CacheNoFile)
      strzcat (FaoString, " cache=NOfile", size);
   else
   if (mrpsptr->CacheFile)
      strzcat (FaoString, " cache=file", size);

   if (mrpsptr->CacheNoNet)
      strzcat (FaoString, " cache=NOnet", size);
   else
   if (mrpsptr->CacheNet)
      strzcat (FaoString, " cache=net", size);

   if (mrpsptr->CacheNoNPH)
      strzcat (FaoString, " cache=noNPH", size);
   else
   if (mrpsptr->CacheNPH)
      strzcat (FaoString, " cache=NPH", size);

   if (mrpsptr->CacheNoPermanent)
      strzcat (FaoString, " cache=NOpermanent", size);
   else
   if (mrpsptr->CachePermanent)
      strzcat (FaoString, " cache=permanent", size);

   if (mrpsptr->CacheNoQuery)
      strzcat (FaoString, " cache=NOquery", size);
   else
   if (mrpsptr->CacheQuery)
      strzcat (FaoString, " cache=query", size);

   if (mrpsptr->CacheNoScript)
      strzcat (FaoString, " cache=NOscript", size);
   else
   if (mrpsptr->CacheScript)
      strzcat (FaoString, " cache=script", size);

   if (mrpsptr->CacheNoSSI)
      strzcat (FaoString, " cache=noSSI", size);
   else
   if (mrpsptr->CacheSSI)
      strzcat (FaoString, " cache=SSI", size);

   if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_NONE)
      strzcat (FaoString, " cache=expires=none", size);
   else
   if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_DAY)
      strzcat (FaoString, " cache=expires=day", size);
   else
   if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_HOUR)
      strzcat (FaoString, " cache=expires=hour", size);
   else
   if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_MINUTE)
      strzcat (FaoString, " cache=expires=minute", size);
   else
   if (mrpsptr->CacheExpiresAfter)
   {
      strzcat (FaoString, " cache=expires=!AZ", size);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->CacheExpiresAfter);
   }

   if (mrpsptr->CacheGuardSeconds)
   {
      strzcat (FaoString, " cache=guard=!UL", size);
      if (mrpsptr->CacheGuardSeconds == -1)
         *vecptr++ = 0;
      else
         *vecptr++ = mrpsptr->CacheGuardSeconds;
   }

   if (mrpsptr->CacheMaxKBytes)
   {
      strzcat (FaoString, " cache=max=!UL", size);
      if (mrpsptr->CacheMaxKBytes == -1)
         *vecptr++ = 0;
      else
         *vecptr++ = mrpsptr->CacheMaxKBytes;
   }

   if (mrpsptr->CgiPlusInNoWriteof)
      strzcat (FaoString, " cgiplusin=NOeof", size);
   else
   if (mrpsptr->CgiPlusInWriteof)
      strzcat (FaoString, " cgiplusin=EOF", size);

   if (mrpsptr->CgiPlusInCC[0] || mrpsptr->CgiPlusInCC[1])
   {
      if (mrpsptr->CgiPlusInCC[0] == '\r' &&
          mrpsptr->CgiPlusInCC[1] == '\n')
         strzcat (FaoString, " cgiplusin=cc=CRLF", size);
      else
      if (mrpsptr->CgiPlusInCC[0] == '\n')
         strzcat (FaoString, " cgiplusin=cc=LF", size);
      else
      if (mrpsptr->CgiPlusInCC[0] == '\r')
         strzcat (FaoString, " cgiplusin=cc=CR", size);
      else
         strzcat (FaoString, " cgiplusin=cc=NONE", size);
   }

   if (mrpsptr->CgiPrefixPtr)
   {
      strzcat (FaoString, " CGI=prefix=!AZ", size);
      *vecptr++ = mrpsptr->CgiPrefixPtr;
   }

   if (mrpsptr->CgiVarPtr)
   {
      strzcat (FaoString, " CGI=var=!AZ", size);
      *vecptr++ = mrpsptr->CgiVarPtr;
   }

   if (mrpsptr->CharsetPtr)
   {
      strzcat (FaoString, " charset=!&\"AZ", size);
      *vecptr++ = mrpsptr->CharsetPtr;
   }

   if (mrpsptr->ClientAddress == MAPURL_CLIENT_FORWARDED)
      strzcat (FaoString, " client=FORWARDED", size);
   else
   if (mrpsptr->ClientAddress == MAPURL_CLIENT_IF_FORWARDED)
      strzcat (FaoString, " client=IF=FORWARDED", size);
   else
   if (mrpsptr->ClientAddress == MAPURL_CLIENT_IF_XFORWARDEDFOR)
      strzcat (FaoString, " client=IF=XFORWARDEDFOR", size);
   else
   if (mrpsptr->ClientAddress == MAPURL_CLIENT_LITERAL)
   {
      strzcat (FaoString, " client=LITERAL=\"!AZ\"", size);
      *vecptr++ = mrpsptr->ClientAddressLiteralPtr;
   }
   else
   if (mrpsptr->ClientAddress == MAPURL_CLIENT_RESET)
      strzcat (FaoString, " client=RESET", size);
   else
   if (mrpsptr->ClientAddress == MAPURL_CLIENT_XFORWARDEDFOR)
      strzcat (FaoString, " client=XFORWARDEDFOR", size);

   if (mrpsptr->ContentTypePtr)
   {
      strzcat (FaoString, " content=!&\"AZ", size);
      *vecptr++ = mrpsptr->ContentTypePtr;
   }

   if (mrpsptr->CorsMaxAge)
   {
      strzcat (FaoString, " cors=AGE=!UL", size);
      *vecptr++ = mrpsptr->CorsMaxAge;
   }

   if (mrpsptr->CorsAllowCredentials)
      strzcat (FaoString, " cors=CRED=true", size);
   else
   if (mrpsptr->CorsNoAllowCredentials)
      strzcat (FaoString, " cors=CRED=false", size);

   if (mrpsptr->CorsExposeHeadersPtr)
   {
      strzcat (FaoString, " cors=EXPOSE=!&\"AZ", size);
      *vecptr++ = mrpsptr->CorsExposeHeadersPtr;
   }

   if (mrpsptr->CorsAllowHeadersPtr)
   {
      strzcat (FaoString, " cors=HEADERS=!&\"AZ", size);
      *vecptr++ = mrpsptr->CorsAllowHeadersPtr;
   }

   if (mrpsptr->CorsAllowMethodsPtr)
   {
      strzcat (FaoString, " cors=METHODS=!&\"AZ", size);
      *vecptr++ = mrpsptr->CorsAllowMethodsPtr;
   }

   if (mrpsptr->CorsAllowOriginPtr)
   {
      strzcat (FaoString, " cors=ORIGIN=!&\"AZ", size);
      *vecptr++ = mrpsptr->CorsAllowOriginPtr;
   }

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
      bptr += slen;
      blen -= slen;
      vecptr = FaoVector;
      FaoString[0] = 0;
   }

   if (mrpsptr->DictionaryPtr)
   {
      strzcat (FaoString, " dict=!&\"AZ", size);
      *vecptr++ = mrpsptr->DictionaryPtr;
   }

   if (mrpsptr->DirNoAccess)
      strzcat (FaoString, " dir=NOaccess", size);
   else
   if (mrpsptr->DirAccess)
      strzcat (FaoString, " dir=access", size);
   else
   if (mrpsptr->DirAccessSelective)
      strzcat (FaoString, " dir=access=selective", size);

   if (mrpsptr->DirCharsetPtr)
   {
      strzcat (FaoString, " dir=charset=!&\"AZ", size);
      *vecptr++ = mrpsptr->DirCharsetPtr;
   }

   if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_BOTH)
      strzcat (FaoString, " dir=DELIMIT=both", size);
   else
   if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_HEADER)
      strzcat (FaoString, " dir=DELIMIT=header", size);
   else
   if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_FOOTER)
      strzcat (FaoString, " dir=DELIMIT=footer", size);
   else
   if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_NONE)
      strzcat (FaoString, " dir=DELIMIT=none", size);

   if (mrpsptr->DirFont == MAPURL_DIR_FONT_INHERIT)
      strzcat (FaoString, " dir=FONT=inherit", size);
   else
   if (mrpsptr->DirFont == MAPURL_DIR_FONT_MONOSPACE)
      strzcat (FaoString, " dir=FONT=monospace", size);

   if (mrpsptr->DirNoIconLink)
      strzcat (FaoString, " dir=NOilink", size);
   else
   if (mrpsptr->DirIconLink)
      strzcat (FaoString, " dir=ilink", size);

   if (mrpsptr->DirNoImpliedWildcard)
      strzcat (FaoString, " dir=NOimpliedwildcard", size);
   else
   if (mrpsptr->DirImpliedWildcard)
      strzcat (FaoString, " dir=impliedwildcard", size);

   if (mrpsptr->DirSort[0])
   {
      strzcat (FaoString, " dir=SORT=!AZ", size);
      *vecptr++ = mrpsptr->DirSort;
   }

   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_DEFAULT)
      strzcat (FaoString, " dir=style=default", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_DEFAULT2)
      strzcat (FaoString, " dir=style=default2", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ANCHOR)
      strzcat (FaoString, " dir=style=anchor", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ANCHOR2)
      strzcat (FaoString, " dir=style=anchor2", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_HTDIR)
      strzcat (FaoString, " dir=style=htdir", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_HTDIR2)
      strzcat (FaoString, " dir=style=htdir2", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ORIGINAL)
      strzcat (FaoString, " dir=style=original", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ORIGINAL2)
      strzcat (FaoString, " dir=style=original2", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_SORT)
      strzcat (FaoString, " dir=style=sort", size);
   else
   if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_SORT2)
      strzcat (FaoString, " dir=style=sort2", size);

   if (mrpsptr->DirTargetPtr)
   {
      strzcat (FaoString, " dir=TARGET=\"!AZ\"", size);
      *vecptr++ = mrpsptr->DirTargetPtr;
   }

   if (mrpsptr->DirThesePtr)
   {
      strzcat (FaoString, " dir=THESE=\"!AZ\"", size);
      *vecptr++ = mrpsptr->DirThesePtr;
   }

   if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_THIS)
   {
      strzcat (FaoString, " dir=TITLE=this=\"!AZ\"", size);
      *vecptr++ = mrpsptr->DirTitlePtr;
   }
   else
   if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_DEFAULT)
      strzcat (FaoString, " dir=TITLE=default", size);
   else
   if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_OWNER)
      strzcat (FaoString, " dir=TITLE=owner", size);
   else
   if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_REMOTE)
      strzcat (FaoString, " dir=TITLE=remote", size);
   else
   if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_NONE)
      strzcat (FaoString, " dir=TITLE=0", size);
   else
   if (mrpsptr->DirTitle)
   {
      strzcat (FaoString, " dir=TITLE=!UL", size);
      *vecptr++ = mrpsptr->DirTitle;
   }

   if (mrpsptr->DirVersionsOf)
   {
      if (mrpsptr->DirVersionsOf == 65536)
         strzcat (FaoString, " dir=VERSIONS=*", size);
      else
      if (mrpsptr->DirVersionsOf == -1)
         strzcat (FaoString, " dir=VERSIONS=0", size);
      else
      {
         strzcat (FaoString, " dir=VERSIONS=!UL", size);
         *vecptr++ = mrpsptr->DirVersionsOf;
      }
   }

   if (mrpsptr->DirNoWildcard)
      strzcat (FaoString, " dir=NOwildcard", size);
   else
   if (mrpsptr->DirWildcard)
      strzcat (FaoString, " dir=wildcard", size);

   if (mrpsptr->NoExpired)
      strzcat (FaoString, " NOexpired", size);
   else
   if (mrpsptr->Expired)
      strzcat (FaoString, " expired", size);

   if (mrpsptr->Http2ToHttp11)
      strzcat (FaoString, " HTTP2=protocol=1.1", size);

   if (mrpsptr->Http2MaxStreams)
   {
      strzcat (FaoString, " HTTP2=streams=max=!UL", size);
      *vecptr++ = mrpsptr->Http2MaxStreams;
   }

   if (mrpsptr->Http2WriteQueue == HTTP2_WRITE_QUEUE_HIGH)
      strzcat (FaoString, " HTTP2=write=high", size);
   else
   if (mrpsptr->Http2WriteQueue == HTTP2_WRITE_QUEUE_NORMAL)
      strzcat (FaoString, " HTTP2=write=normal", size);
   else
   if (mrpsptr->Http2WriteQueue == HTTP2_WRITE_QUEUE_LOW)
      strzcat (FaoString, " HTTP2=write=low", size);

   if (mrpsptr->Http2SendGoAway)
   {
      strzcat (FaoString, " HTTP2=send=goaway=!UL", size);
      *vecptr++ = mrpsptr->Http2SendGoAway - 1;
   }

   if (mrpsptr->Http2SendPing)
      strzcat (FaoString, " HTTP2=send=ping", size);

   if (mrpsptr->Http2SendReset)
   {
      strzcat (FaoString, " HTTP2=send=reset=!UL", size);
      *vecptr++ = mrpsptr->Http2SendReset - 1;
   }

   if (mrpsptr->HttpAcceptCharsetPtr)
   {
      strzcat (FaoString, " http=Accept-Charset=!&\"AZ", size);
      *vecptr++ = mrpsptr->HttpAcceptCharsetPtr;
   }

   if (mrpsptr->HtmlBodyTagPtr)
   {
      strzcat (FaoString, " html=bodytag=!&\"AZ", size);
      *vecptr++ = mrpsptr->HtmlBodyTagPtr;
   }

   if (mrpsptr->HtmlHeaderTagPtr)
   {
      strzcat (FaoString, " html=headertag=!&\"AZ", size);
      *vecptr++ = mrpsptr->HtmlHeaderTagPtr;
   }

   if (mrpsptr->HtmlHeaderPtr)
   {
      strzcat (FaoString, " html=header=!&\"AZ", size);
      *vecptr++ = mrpsptr->HtmlHeaderPtr;
   }

   if (mrpsptr->HtmlFooterTagPtr)
   {
      strzcat (FaoString, " html=footertag=!&\"AZ", size);
      *vecptr++ = mrpsptr->HtmlFooterTagPtr;
   }

   if (mrpsptr->HtmlFooterPtr)
   {
      strzcat (FaoString, " html=footer=!&\"AZ", size);
      *vecptr++ = mrpsptr->HtmlFooterPtr;
   }

   if (mrpsptr->HttpAcceptLangPtr)
   {
      strzcat (FaoString, " http=Accept-Language=!&\"AZ", size);
      *vecptr++ = mrpsptr->HttpAcceptLangPtr;
   }

   if (mrpsptr->IndexPtr)
   {
      strzcat (FaoString, " index=!AZ", size);
      *vecptr++ = mrpsptr->IndexPtr;
   }

   if (mrpsptr->NoLog)
      strzcat (FaoString, " NOlog", size);
   else
   if (mrpsptr->Log)
      strzcat (FaoString, " log", size);

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
      bptr += slen;
      blen -= slen;
      vecptr = FaoVector;
      FaoString[0] = '\0';
   }

   if (mrpsptr->NoMapEllipsis)
      strzcat (FaoString, " map=NOELLIPSIS", size);
   else
   if (mrpsptr->MapEllipsis)
      strzcat (FaoString, " map=ELLIPSIS", size);

   if (mrpsptr->MapNonEmpty)
      strzcat (FaoString, " map=NOEMPTY", size);
   else
   if (mrpsptr->MapEmpty)
      strzcat (FaoString, " map=EMPTY", size);

   if (mrpsptr->NoMapExtensionMethod)
      strzcat (FaoString, " map=NOMETHOD", size);
   else
   if (mrpsptr->MapExtensionMethod)
      strzcat (FaoString, " map=METHOD", size);

   if (mrpsptr->NoMapOnce)
      strzcat (FaoString, " map=NOONCE", size);
   else
   if (mrpsptr->MapOnce)
      strzcat (FaoString, " map=ONCE", size);

   if (mrpsptr->MapRestart)
      strzcat (FaoString, " map=RESTART", size);

   if (mrpsptr->MapSetNoIgnore)
      strzcat (FaoString, " map=SET=noignore", size);
   else
   if (mrpsptr->MapSetIgnore)
      strzcat (FaoString, " map=SET=ignore", size);

   if (mrpsptr->MapSetNoRequest)
      strzcat (FaoString, " map=SET=norequest", size);
   else
   if (mrpsptr->MapSetRequest)
      strzcat (FaoString, " map=SET=request", size);

   if (mrpsptr->MapUri)
      strzcat (FaoString, " map=URI", size);

   if (mrpsptr->MapRootPtr)
   {
      strzcat (FaoString, " map=ROOT=!AZ", size);
      *vecptr++ = mrpsptr->MapRootPtr;
   }

   if (mrpsptr->NoOp)
      strzcat (FaoString, " NOOP", size);

   if (mrpsptr->NotePadPtr)
   {
      strzcat (FaoString, " notepad=!&\"AZ", size);
      *vecptr++ = mrpsptr->NotePadPtr;
   }

   if (mrpsptr->PathOds == MAPURL_PATH_ODS_0)
      strzcat (FaoString, " NOods", size);
   else
   if (mrpsptr->PathOds == MAPURL_PATH_ODS_2)
      strzcat (FaoString, " ods=2", size);
   else
   if (mrpsptr->PathOds == MAPURL_PATH_ODS_5)
      strzcat (FaoString, " ods=5", size);
   else
   if (mrpsptr->PathOds == MAPURL_PATH_ODS_ADS)
      strzcat (FaoString, " ods=ADS", size);
   else
   if (mrpsptr->PathOds == MAPURL_PATH_ODS_PWK)
      strzcat (FaoString, " ods=PWK", size);
   else
   if (mrpsptr->PathOds == MAPURL_PATH_ODS_SMB)
      strzcat (FaoString, " ods=SMB", size);
   else
   if (mrpsptr->PathOds == MAPURL_PATH_ODS_SRI)
      strzcat (FaoString, " ods=SRI", size);

   if (mrpsptr->OdsName == MAPURL_ODS_8BIT)
      strzcat (FaoString, " ods=name=8BIT", size);
   else
   if (mrpsptr->OdsName == MAPURL_ODS_UTF8)
      strzcat (FaoString, " ods=name=UTF8", size);
   else
   if (mrpsptr->OdsName == MAPURL_ODS_DEFAULT)
      strzcat (FaoString, " ods=name=DEFAULT", size);

   if (mrpsptr->NoProfile)
      strzcat (FaoString, " NOprofile", size);
   else
   if (mrpsptr->Profile)
      strzcat (FaoString, " profile", size);

   if (mrpsptr->ProxyNoAffinity)
      strzcat (FaoString, " proxy=NOAFFINITY", size);
   else
   if (mrpsptr->ProxyAffinity)
      strzcat (FaoString, " proxy=AFFINITY", size);

   if (mrpsptr->ProxyBindIpAddressPtr)
   {
      strzcat (FaoString, " proxy=BIND=!AZ", size);
      *vecptr++ = mrpsptr->ProxyBindIpAddressPtr;
   }

   if (mrpsptr->ProxyChainHostPortPtr)
   {
      strzcat (FaoString, " proxy=CHAIN=!AZ", size);
      *vecptr++ = mrpsptr->ProxyChainHostPortPtr;
   }

   if (mrpsptr->ProxyChainCredPtr)
   {
      strzcat (FaoString, " proxy=CHAIN=CRED=!AZ", size);
      *vecptr++ = mrpsptr->ProxyChainCredPtr;
   }

   if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_NONE)
      strzcat (FaoString, " proxy=NOforwarded", size);
   else
   if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_BY)
      strzcat (FaoString, " proxy=FORWARDED=by", size);
   else
   if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_FOR)
      strzcat (FaoString, " proxy=FORWARDED=for", size);
   else
   if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_ADDRESS)
      strzcat (FaoString, " proxy=FORWARDED=address", size);

   if (mrpsptr->ProxyReverseLocationLength)
   {
      strzcat (FaoString, " proxy=REVERSE=location=!AZ", size);
      *vecptr++ = mrpsptr->ProxyReverseLocationPtr;
   }

   if (mrpsptr->ProxyReworkLength)
   {
      strzcat (FaoString, " proxy=REWORK=!AZ", size);
      *vecptr++ = mrpsptr->ProxyReworkPtr;
   }

   if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_NONE)
      strzcat (FaoString, " proxy=NOxforwardedfor", size);
   else
   if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_ENABLED)
      strzcat (FaoString, " proxy=XFORWARDEDFOR=enabled", size);
   else
   if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_ADDRESS)
      strzcat (FaoString, " proxy=XFORWARDEDFOR=address", size);
   else
   if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_UNKNOWN)
      strzcat (FaoString, " proxy=XFORWARDEDFOR=unknown", size);

   if (mrpsptr->NoProxyReverseVerify)
      strzcat (FaoString, " proxy=REVERSE=NOverify", size);
   else
   if (mrpsptr->ProxyReverseVerify)
      strzcat (FaoString, " proxy=REVERSE=verify", size);

   if (mrpsptr->NoProxyReverseAuthHeader)
      strzcat (FaoString, " proxy=REVERSE=NOauth", size);
   else
   if (mrpsptr->ProxyReverseAuthHeader)
      strzcat (FaoString, " proxy=REVERSE=auth", size);

   if (mrpsptr->ProxyTunnelRequestPtr)
   {
      strzcat (FaoString, " proxy=tunnel=request=!&\\&\"AZ", size);
      *vecptr++ = mrpsptr->ProxyTunnelRequestPtr;
   }

   if (mrpsptr->NoProxyUnknownRequestFields)
      strzcat (FaoString, " proxy=NOUNKNOWN", size);
   else
   if (mrpsptr->ProxyUnknownRequestFields)
      strzcat (FaoString, " proxy=UNKNOWN", size);

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
      bptr += slen;
      blen -= slen;
      vecptr = FaoVector;
      FaoString[0] = '\0';
   }

   if (mrpsptr->ProxyHeaderCount)
   {
      for (int idx = 0; idx < mrpsptr->ProxyHeaderCount; idx++)
      {
         *vecptr++ = mrpsptr->ProxyHeader[idx];
         status = FaolToBuffer (bptr, blen, &slen, " proxy=HEADER=!AZ",
                                &FaoVector);
         if (VMSnok (status) || status == SS$_BUFFEROVF)
         {
            ErrorNoticed (rqptr, status, NULL, FI_LI);
            return ("*ERROR*");
         }
         bptr += slen;
         blen -= slen;
         vecptr = FaoVector;
         FaoString[0] = '\0';
      }
   }

   if (mrpsptr->PutRFM == PUT_RFM_FIX512)
      strzcat (FaoString, " put=FIX512", size);
   else
   if (mrpsptr->PutRFM == PUT_RFM_STM)
      strzcat (FaoString, " put=STM", size);
   else
   if (mrpsptr->PutRFM == PUT_RFM_STMCR)
      strzcat (FaoString, " put=STMCR", size);
   else
   if (mrpsptr->PutRFM == PUT_RFM_STMLF)
      strzcat (FaoString, " put=STMLF", size);
   else
   if (mrpsptr->PutRFM == PUT_RFM_UDF)
      strzcat (FaoString, " put=UDF", size);

   if (mrpsptr->PutMaxKbytes)
   {
      strzcat (FaoString, " put=MAX=!UL", size);
      *vecptr++ = mrpsptr->PutMaxKbytes;
   }

   if (mrpsptr->RegexSyntax)
   {
      strzcat (FaoString, " regex=!AZ", size);
      switch (mrpsptr->RegexSyntax)
      {
         case RE_SYNTAX_AWK :
              *vecptr++ = "AWK";
              break; 
         case RE_SYNTAX_EGREP :
              *vecptr++ = "EGREP";
              break; 
         case RE_SYNTAX_GREP :
              *vecptr++ = "GREP";
              break; 
         case RE_SYNTAX_POSIX_AWK :
              *vecptr++ = "POSIX_AWK";
              break; 
         case RE_SYNTAX_POSIX_BASIC :
              *vecptr++ = "POSIX_BASIC/ED/SED";
              break; 
         case RE_SYNTAX_POSIX_EGREP :
              *vecptr++ = "POSIX_EGREP";
              break; 
         case RE_SYNTAX_POSIX_EXTENDED :
              *vecptr++ = "POSIX_EXTENDED";
              break; 
         case RE_SYNTAX_POSIX_MINIMAL_BASIC :
              *vecptr++ = "POSIX_MINIMAL_BASIC";
              break; 
         case RE_SYNTAX_POSIX_MINIMAL_EXTENDED :
              *vecptr++ = "POSIX_MINIMAL_EXTENDED";
              break; 
         case REGEX_C_FLAGS :
              *vecptr++ = "WASD";
              break; 
         case -1 :
              *vecptr++ = "default";
              break; 
         default :
              vecptr--;  /** jump back one! **/
              *vecptr++ = " regex=!8XL";
              *vecptr = mrpsptr->RegexSyntax;
      }
   }

   if (mrpsptr->ReportType == ERROR_REPORT_BASIC)
      strzcat (FaoString, " report=BASIC", size);
   else
   if (mrpsptr->ReportType == ERROR_REPORT_DETAILED)
      strzcat (FaoString, " report=DETAILED", size);
   else
   if (mrpsptr->ReportType == ERROR_REPORT_TUNNEL)
      strzcat (FaoString, " report=TUNNEL", size);

   if (mrpsptr->Report400as)
   {
      strzcat (FaoString, " report=400=!UL", size);
      *vecptr++ = mrpsptr->Report400as;
   }

   if (mrpsptr->Report403as)
   {
      strzcat (FaoString, " report=403=!UL", size);
      *vecptr++ = mrpsptr->Report403as;
   }

   if (mrpsptr->Report404as)
   {
      strzcat (FaoString, " report=404=!UL", size);
      *vecptr++ = mrpsptr->Report404as;
   }

   if (mrpsptr->Response200is203 == 203)
      strzcat (FaoString, " response=200=203", size);
   else
   if (mrpsptr->Response200is203 == 200)
      strzcat (FaoString, " response=203=200", size);

   if (mrpsptr->ResponseGzip == MAPURL_RESPONSE_GZIP_ALL)
      strzcat (FaoString, " response=GZIP=all", size);
   else
   if (mrpsptr->ResponseGzip == MAPURL_RESPONSE_GZIP_NONE)
      strzcat (FaoString, " response=GZIP=none", size);
   else
   if (mrpsptr->ResponseGzip)
   {
      strzcat (FaoString, " response=GZIP=!UL", size);
      *vecptr++ = mrpsptr->ResponseGzip;
   }

   if (mrpsptr->ResponseNoChunked)
      strzcat (FaoString, " response=NOchunked", size);
   else
   if (mrpsptr->ResponseChunked)
      strzcat (FaoString, " response=chunked", size);

   if (mrpsptr->ResponseCspLength)
   {
      if (mrpsptr->ResponseCspLength < 0)
         strzcat (FaoString, " response=NOcsp", size);
      else
      {
         strzcat (FaoString, " response=csp=!&\"AZ", size);
         *vecptr++ = mrpsptr->ResponseCspPtr;
      }
   }

   if (mrpsptr->ResponseCsproLength)
   {
      if (mrpsptr->ResponseCsproLength < 0)
         strzcat (FaoString, " response=NOcspro", size);
      else
      {
         strzcat (FaoString, " response=cspro=!&\"AZ", size);
         *vecptr++ = mrpsptr->ResponseCsproPtr;
      }
   }

   if (mrpsptr->ResponseHeaderNone)
      strzcat (FaoString, " response=header=none", size);
   else
   if (mrpsptr->ResponseHeaderBegin)
      strzcat (FaoString, " response=header=begin", size);
   else
   if (mrpsptr->ResponseHeaderFull)
      strzcat (FaoString, " response=header=full", size);

   if (mrpsptr->ResponseHeaderNoAdd)
      strzcat (FaoString, " response=header=NOadd", size);

   if (mrpsptr->ResponseHeaderAddLength)
   {
      strzcat (FaoString, " response=header=add=!&\"AZ", size);
      *vecptr++ = mrpsptr->ResponseHeaderAddPtr;
   }

   if (mrpsptr->ResponseHttpNoOriginal)
      strzcat (FaoString, " response=HTTP=NOoriginal", size);
   else
   if (mrpsptr->ResponseHttpOriginal)
      strzcat (FaoString, " response=HTTP=original", size);

   if (mrpsptr->ResponseStrictTransSecPtr)
   {
      strzcat (FaoString, " response=STS=\"!AZ\"", size);
      *vecptr++ = mrpsptr->ResponseStrictTransSecPtr;
   }

   if (mrpsptr->ResponseVarRecord == FILE_VAR_ASIS)
      strzcat (FaoString, " response=VAR=ASIS", size);
   else
   if (mrpsptr->ResponseVarRecord == FILE_VAR_CRLF)
      strzcat (FaoString, " response=VAR=CRLF", size);
   else
   if (mrpsptr->ResponseVarRecord == FILE_VAR_LF)
      strzcat (FaoString, " response=VAR=LF", size);
   else
   if (mrpsptr->ResponseVarRecord == FILE_VAR_NONE)
      strzcat (FaoString, " response=VAR=NONE", size);

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
      bptr += slen;
      blen -= slen;
      vecptr = FaoVector;
      FaoString[0] = '\0';
   }

   if (mrpsptr->ScriptBodyNoDecode)
      strzcat (FaoString, " script=BODY=NOdecode", size);
   else
   if (mrpsptr->ScriptBodyDecode)
      strzcat (FaoString, " script=BODY=decode", size);

   if (mrpsptr->ScriptSymbolNoTruncate)
      strzcat (FaoString, " script=SYMBOL=NOtruncate", size);
   else
   if (mrpsptr->ScriptSymbolTruncate)
      strzcat (FaoString, " script=SYMBOL=truncate", size);

   if (mrpsptr->ScriptSyntaxNoUnix)
      strzcat (FaoString, " script=SYNTAX=NOunix", size);
   else
   if (mrpsptr->ScriptSyntaxUnix)
      strzcat (FaoString, " script=SYNTAX=unix", size);

   if (mrpsptr->ScriptNoFind)
      strzcat (FaoString, " script=NOfind", size);
   else
   if (mrpsptr->ScriptFind)
      strzcat (FaoString, " script=FIND", size);

   if (mrpsptr->ScriptNoPathFind)
      strzcat (FaoString, " NOscript=PATH=find", size);
   else
   if (mrpsptr->ScriptPathFind)
      strzcat (FaoString, " script=PATH=find", size);

   if (mrpsptr->ScriptNoQueryNone)
      strzcat (FaoString, " NOscript=QUERY=none", size);
   else
   if (mrpsptr->ScriptQueryNone)
      strzcat (FaoString, " script=QUERY=none", size);

   if (mrpsptr->ScriptNoQueryRelaxed)
      strzcat (FaoString, " NOscript=QUERY=relaxed", size);
   else
   if (mrpsptr->ScriptQueryRelaxed)
      strzcat (FaoString, " script=QUERY=relaxed", size);

   if (mrpsptr->NoDefaultSearch)
      strzcat (FaoString, " search=none", size);
   else
   if (mrpsptr->DefaultSearch)
      strzcat (FaoString, " NOsearch=none", size);

   if (mrpsptr->ChangeServicePtr)
   {
      strzcat (FaoString, " service=!AZ", size);
      *vecptr++ = mrpsptr->ChangeServicePtr;
   }

   if (mrpsptr->NoPrivSsi)
      strzcat (FaoString, " NOssi=PRIV", size);
   else
   if (mrpsptr->PrivSsi)
      strzcat (FaoString, " ssi=PRIV", size);

   if (mrpsptr->SsiExecPtr)
   {
      strzcat (FaoString, " ssi=EXEC=!AZ", size);
      *vecptr++ = mrpsptr->SsiExecPtr;
   }

   if (mrpsptr->StyleSheetPtr)
   {
      strzcat (FaoString, " css=!AZ", size);
      *vecptr++ = mrpsptr->StyleSheetPtr;
   }

   if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL)
      strzcat (FaoString, " SSLCGI=Apache_mod_SSL", size);
   else
   if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL_CLIENT)
      strzcat (FaoString, " SSLCGI=Apache_mod_SSL_client", size);
   else
   if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL_EXTENS)
      strzcat (FaoString, " SSLCGI=Apache_mod_SSL_extens", size);
   else
   if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL_OID)
      strzcat (FaoString, " SSLCGI=Apache_mod_SSL_OID", size);
   else
   if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_PURVEYOR)
      strzcat (FaoString, " SSLCGI=Purveyor", size);

   if (mrpsptr->NoStmLF)
      strzcat (FaoString, " NOstmLF", size);
   else
   if (mrpsptr->StmLF)
      strzcat (FaoString, " stmLF", size);

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
      bptr += slen;
      blen -= slen;
      vecptr = FaoVector;
      FaoString[0] = '\0';
   }

   if (mrpsptr->QueryStringPtr)
   {
      strzcat (FaoString, " query-string=!&\"AZ", size);
      *vecptr++ = mrpsptr->QueryStringPtr;
   }

   if (mrpsptr->RmsSubChar)
   {
      strzcat (FaoString, " RMSchar=!&C", size);
      *vecptr++ = mrpsptr->RmsSubChar;
   }

   if (mrpsptr->ScriptAgentAsPtr)
   {
      strzcat (FaoString, " script=AGENT=AS=!AZ", size);
      *vecptr++ = mrpsptr->ScriptAgentAsPtr;
   }

   if (mrpsptr->ScriptAsPtr)
   {
      strzcat (FaoString, " script=AS=!AZ", size);
      *vecptr++ = mrpsptr->ScriptAsPtr;
   }

   if (mrpsptr->ScriptCommandPtr)
   {
      strzcat (FaoString, " script=COMMAND=!&\"AZ", size);
      *vecptr++ = mrpsptr->ScriptCommandPtr;
   }

   if (mrpsptr->ScriptControlPtr)
   {
      strzcat (FaoString, " script=CONTROL=!&\"AZ", size);
      *vecptr++ = mrpsptr->ScriptControlPtr;
   }

   if (mrpsptr->ScriptDefaultPtr)
   {
      strzcat (FaoString, " script=DEFAULT=!AZ", size);
      *vecptr++ = mrpsptr->ScriptDefaultPtr;
   }

   if (mrpsptr->ScriptBitBucketTimeout)
   {
      strzcat (FaoString, " script=BIT-BUCKET=!AZ", size);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->ScriptBitBucketTimeout);
   }

   if (mrpsptr->ScriptCpuMax)
   {
      strzcat (FaoString, " script=CPU=!UL", size);
      *vecptr++ = mrpsptr->ScriptCpuMax;
   }

   if (mrpsptr->ScriptLifeTime)
   {
      strzcat (FaoString, " script=lifetime=!AZ", size);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->ScriptLifeTime);
   }

   if (mrpsptr->ScriptParamsPtr)
   {
      strzcat (FaoString, " script=PARAMS=!&\"AZ", size);
      *vecptr++ = mrpsptr->ScriptParamsPtr;
   }

   if (mrpsptr->TimeoutPersistent > 0 ||
       mrpsptr->TimeoutNoProgress > 0 ||
       mrpsptr->TimeoutOutput > 0)
   {
      strzcat (FaoString, " timeout=!AZ(p),!AZ(np),!AZ(o)", size);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->TimeoutPersistent);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->TimeoutNoProgress);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->TimeoutOutput);
   }
   else
   if (mrpsptr->TimeoutPersistent < 0 &&
       mrpsptr->TimeoutNoProgress < 0 &&
       mrpsptr->TimeoutOutput < 0)
      strzcat (FaoString, " notimeout", size);

   if (mrpsptr->ThrottleNoSet)
      strzcat (FaoString, " throttle=NONE", size);
   else
   if (mrpsptr->ThrottleSet)
   {
      if (mrpsptr->ThrottlePerUser)
      {
         strzcat (FaoString, " throttle=!UL$!UL,!UL,!UL,!UL,!AZ,!AZ", size);
         *vecptr++ = mrpsptr->ThrottleFrom;
         *vecptr++ = mrpsptr->ThrottlePerUser;
      }
      else
      {
         strzcat (FaoString, " throttle=!UL,!UL,!UL,!UL,!AZ,!AZ", size);
         *vecptr++ = mrpsptr->ThrottleFrom;
      }
      *vecptr++ = mrpsptr->ThrottleTo;
      *vecptr++ = mrpsptr->ThrottleResume;
      *vecptr++ = mrpsptr->ThrottleBusy;
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->ThrottleTimeoutQueue);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->ThrottleTimeoutBusy);
   }

   if (mrpsptr->AccessNoProfile)
      strzcat (FaoString, " access=NOprofile", size);
   else
   if (mrpsptr->AccessProfile)
      strzcat (FaoString, " access=profile", size);

   if (mrpsptr->AccessNoRead)
      strzcat (FaoString, " access=NOread", size);
   else
   if (mrpsptr->AccessRead)
      strzcat (FaoString, " access=read", size);

   if (mrpsptr->AccessNoServer)
      strzcat (FaoString, " access=NOserver", size);
   else
   if (mrpsptr->AccessServer)
      strzcat (FaoString, " access=server", size);

   if (mrpsptr->AccessNoWrite)
      strzcat (FaoString, " access=NOwrite", size);
   else
   if (mrpsptr->AccessWrite)
      strzcat (FaoString, " access=write", size);

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
      bptr += slen;
      blen -= slen;
      vecptr = FaoVector;
      FaoString[0] = '\0';
   }

   if (mrpsptr->WebDavNoAll)
      strzcat (FaoString, " WebDAV=NOall", size);
   else
   if (mrpsptr->WebDavAll)
      strzcat (FaoString, " WebDAV=all", size);

   if (mrpsptr->WebDavNoAuth)
      strzcat (FaoString, " WebDAV=NOauth", size);
   else
   if (mrpsptr->WebDavAuth)
      strzcat (FaoString, " WebDAV=auth", size);

   if (mrpsptr->WebDavNoServer)
      strzcat (FaoString, " WebDAV=NOserver", size);
   else
   if (mrpsptr->WebDavServer)
      strzcat (FaoString, " WebDAV=server", size);

   if (mrpsptr->WebDavNoHidden)
      strzcat (FaoString, " WebDAV=NOhidden", size);
   else
   if (mrpsptr->WebDavHidden)
      strzcat (FaoString, " WebDAV=hidden", size);

   if (mrpsptr->WebDavNoLock)
      strzcat (FaoString, " WebDAV=NOlock", size);
   else
   if (mrpsptr->WebDavLock)
      strzcat (FaoString, " WebDAV=lock", size);

   if (mrpsptr->WebDavMetaDirPtr)
   {
      strzcat (FaoString, " webdav=META=dir=!&\"AZ", size);
      *vecptr++ = mrpsptr->WebDavMetaDirPtr;
   }

   if (mrpsptr->WebDavNoProfile)
      strzcat (FaoString, " WebDAV=NOprofile", size);
   else
   if (mrpsptr->WebDavProfile)
      strzcat (FaoString, " WebDAV=profile", size);

   if (mrpsptr->WebDavNoProp)
      strzcat (FaoString, " WebDAV=NOprop", size);
   else
   if (mrpsptr->WebDavProp)
      strzcat (FaoString, " WebDAV=prop", size);

   if (mrpsptr->WebDavNoPutLock)
      strzcat (FaoString, " WebDAV=NOPUT=lock", size);
   else
   if (mrpsptr->WebDavPutLock)
      strzcat (FaoString, " WebDAV=PUT=lock", size);

   if (mrpsptr->WebDavNoRead)
      strzcat (FaoString, " WebDAV=NOread", size);
   else
   if (mrpsptr->WebDavRead)
      strzcat (FaoString, " WebDAV=read", size);

   if (mrpsptr->WebDavNoWinProp)
      strzcat (FaoString, " WebDAV=NOwinprop", size);
   else
   if (mrpsptr->WebDavWinProp)
      strzcat (FaoString, " WebDAV=winprop", size);

   if (mrpsptr->WebDavNoWrite)
      strzcat (FaoString, " WebDAV=NOwrite", size);
   else
   if (mrpsptr->WebDavWrite)
      strzcat (FaoString, " WebDAV=write", size);

   if (mrpsptr->WebDavLockTimeoutDefault)
   {
      strzcat (FaoString, " WebDAV=lock=timeout=default=!AZ", size);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->WebDavLockTimeoutDefault);
   }

   if (mrpsptr->WebDavLockTimeoutMax)
   {
      strzcat (FaoString, " WebDAV=lock=timeout=max=!AZ", size);
      *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->WebDavLockTimeoutMax);
   }

   if (mrpsptr->WebSocketInputSize)
   {
      strzcat (FaoString, " WebSocket=input=!UL", size);
      *vecptr++ = mrpsptr->WebSocketInputSize;
   }

   if (mrpsptr->WebSocketOutputSize)
   {
      strzcat (FaoString, " WebSocket=output=!UL", size);
      *vecptr++ = mrpsptr->WebSocketOutputSize;
   }

   if (FaoString[0])
   {
      status = FaolToBuffer (bptr, blen, &slen, FaoString, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
      {
         ErrorNoticed (rqptr, status, NULL, FI_LI);
         return ("*ERROR*");
      }
   }

   return (Buffer);
}

/*****************************************************************************/

