/*****************************************************************************/ #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=][,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= 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= revalidate authentication for this path at the specified interval AUTH=SYSUAF=PWDEXPURL= 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= specify the exact period before expiry CACHE=[NO]FILE cache files CACHE=GUARD= prevent (Pragma:) reloads during these seconds CACHE=MAX= 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= instead of the default "WWW_" specify what is needed, to have no prefix at all specify CGI=PREFIX= CGI=VAR= (re)set a CGI variable (=) CHARSET= 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= 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= style sheet to load to customise server-generated pages DICT=[!][[= 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= DIR=SORT=[+|-] 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= open a file in this window (e.g. "_blank") DIR=TITLE= 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=[,] one of more wildcard file name selectors DIR=VERSIONS=|* 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 tag HTML=HEADER= HTML page header text (can include markup) HTML=HEADERTAG= HTML header tag (usually colour) HTML=FOOTER= HTML page footer text (can include markup) HTML=FOOTERTAG= HTML footer tag (usually colour) HTTP=ACCEPT-CHARSET= explicitly set the request's accepted charset HTTP=ACCEPT-LANGUAGE= explicitly set the request's accepted language HTTP2=PROTOCOL=1.1 downgrade HTTP/2 to HTTP/1.1 (immediately) HTTP2=SEND=GOAWAY[=] send GOAWAY frame with optional error code HTTP2=SEND=PING send PING frame HTTP2=SEND=RESET[=] send RST_STREAM frame with optional error code HTTP2=STREAMS=MAX= per-path maximum concurrent streams HTTP2=WRITE=[low|normal|high] set response write priority INDEX= "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= 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=[+] 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= bind the outgoing proxy socket to this IP address PROXY=CHAIN= chain to this proxy server PROXY=CHAIN=CRED= : credentials for chain PROXY=HEADER=[=] 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= replacement strings when reworking proxy response PROXY=TUNNEL=REQUEST= make this the tunnelled request PUT=MAX= 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= set the request's query-string (URL-encode if necessary) REGEX= AWK, DEFAULT, ED, EGREP, GREP, POSIX_AWK, POSIX_BASIC, POSIX_EGREP, POSIX_EXTENDED, POSIX_MINIMAL_BASIC, POSIX_MINIMAL_EXTENDED, SED, WASD REPORT=400= bad request reported as (e.g. "report=400=403") REPORT=403= forbidden reported as (e.g. "report=403=404") REPORT=404= 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= add Content Security Policy to response header RESPONSE=[NO]CSPRO= add CSP Report Only to response header RESPONSE=HEADER=ADD= 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= 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= Strict-Transport-Security: header RESPONSE=VAR reset variable length record to default () 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 RESPONSE=VAR=LF append (default) RESPONSE=VAR=NONE append nothing RMSCHAR= 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= the script process will be using this username/account (only applies if detached script processes are enabled) SCRIPT=BIT-BUCKET= 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= provide the script activation command-line with qualifiers, parameters, etc. (first character must be an asterisk or it overrides the full verb) SCRIPT=CONTROL= equivalent of "Script-Control:" in CGI response SCRIPT=CPU= CPU limit for each *script's* processing (not a per-process limit like CPULM would be) SCRIPT=DEFAULT= 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= 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= 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= 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= size of WEBSOCKET_INPUT mailbox WEBSOCKET=OUTPUT= 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 #include #include #include /* VMS related header files */ #include #include #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 int ToLowerCase[], ToUpperCase[]; 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)) strcpy (mrpsptr->CgiPlusInCC, "\0**"); else if (strsame (SetPathPtr, "CGIPLUSIN=CC=LF", -1)) strcpy (mrpsptr->CgiPlusInCC, "\n\0*"); else if (strsame (SetPathPtr, "CGIPLUSIN=CC=CR", -1)) strcpy (mrpsptr->CgiPlusInCC, "\r\0*"); else if (strsame (SetPathPtr, "CGIPLUSIN=CC=CRLF", -1)) strcpy (mrpsptr->CgiPlusInCC, "\r\n\0"); 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] = TOUP(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 = TOUP(*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 = TOUP(*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. Map that onto the request path settings. */ MapSetPath ( REQUEST_STRUCT *rqptr, REQUEST_PATHSET *rqpsptr, MAP_SET_META *mrpsptr ) { int length; 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, strlen(mrpsptr->ProxyHeader[idx])); strcpy (rqpsptr->ProxyHeader[idx], mrpsptr->ProxyHeader[idx]); } } 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->ResponseNoChunked = false; 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, 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; if (mrpsptr->NoAcceptLang) strcat (FaoString, " NOaccept=LANG"); else if (mrpsptr->AcceptLangChar) { strcat (FaoString, " accept=LANG=(default=!AZ,char=!&C,!&?type\rname\r)"); if (mrpsptr->AcceptLangPtr) *vecptr++ = mrpsptr->AcceptLangPtr; else *vecptr++ = ""; *vecptr++ = mrpsptr->AcceptLangChar; *vecptr++ = mrpsptr->AcceptLangTypeVariant; } if (mrpsptr->NoAlert) strcat (FaoString, " NOALERT"); else if (mrpsptr->Alert == MAPURL_PATH_ALERT_END) strcat (FaoString, " ALERT=end"); else if (mrpsptr->Alert == MAPURL_PATH_ALERT_AUTH) strcat (FaoString, " ALERT=auth"); else if (mrpsptr->Alert == MAPURL_PATH_ALERT_MAP) strcat (FaoString, " ALERT=map"); else if (mrpsptr->Alert) { strcat (FaoString, " ALERT=!UL"); *vecptr++ = mrpsptr->Alert; } if (mrpsptr->NoAuthAll) strcat (FaoString, " NOauth=ALL"); else if (mrpsptr->AuthAll) strcat (FaoString, " auth=ALL"); if (mrpsptr->NoAuthMapped) strcat (FaoString, " NOauth=MAPPED"); else if (mrpsptr->AuthMapped) strcat (FaoString, " auth=MAPPED"); if (mrpsptr->NoAuthOnce) strcat (FaoString, " NOauth=ONCE"); else if (mrpsptr->AuthOnce) strcat (FaoString, " auth=ONCE"); if (mrpsptr->AuthSysUafPwdExpUrlPtr) { strcat (FaoString, " auth=SYSUAF=pwdexpURL=!&\"AZ"); *vecptr++ = mrpsptr->AuthSysUafPwdExpUrlPtr; } if (mrpsptr->AuthRevalidateTimeout) { strcat (FaoString, " auth=REVALIDATE=!AZ"); *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) strcat (FaoString, " NOcache"); else if (mrpsptr->Cache) strcat (FaoString, " cache"); if (mrpsptr->CacheNoCGI) strcat (FaoString, " cache=noCGI"); else if (mrpsptr->CacheCGI) strcat (FaoString, " cache=CGI"); if (mrpsptr->CacheNoCookie) strcat (FaoString, " cache=nocookie"); else if (mrpsptr->CacheCookie) strcat (FaoString, " cache=cookie"); if (mrpsptr->CacheNoFile) strcat (FaoString, " cache=NOfile"); else if (mrpsptr->CacheFile) strcat (FaoString, " cache=file"); if (mrpsptr->CacheNoNet) strcat (FaoString, " cache=NOnet"); else if (mrpsptr->CacheNet) strcat (FaoString, " cache=net"); if (mrpsptr->CacheNoNPH) strcat (FaoString, " cache=noNPH"); else if (mrpsptr->CacheNPH) strcat (FaoString, " cache=NPH"); if (mrpsptr->CacheNoPermanent) strcat (FaoString, " cache=NOpermanent"); else if (mrpsptr->CachePermanent) strcat (FaoString, " cache=permanent"); if (mrpsptr->CacheNoQuery) strcat (FaoString, " cache=NOquery"); else if (mrpsptr->CacheQuery) strcat (FaoString, " cache=query"); if (mrpsptr->CacheNoScript) strcat (FaoString, " cache=NOscript"); else if (mrpsptr->CacheScript) strcat (FaoString, " cache=script"); if (mrpsptr->CacheNoSSI) strcat (FaoString, " cache=noSSI"); else if (mrpsptr->CacheSSI) strcat (FaoString, " cache=SSI"); if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_NONE) strcat (FaoString, " cache=expires=none"); else if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_DAY) strcat (FaoString, " cache=expires=day"); else if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_HOUR) strcat (FaoString, " cache=expires=hour"); else if (mrpsptr->CacheExpiresAfter == CACHE_EXPIRES_MINUTE) strcat (FaoString, " cache=expires=minute"); else if (mrpsptr->CacheExpiresAfter) { strcat (FaoString, " cache=expires=!AZ"); *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->CacheExpiresAfter); } if (mrpsptr->CacheGuardSeconds) { strcat (FaoString, " cache=guard=!UL"); if (mrpsptr->CacheGuardSeconds == -1) *vecptr++ = 0; else *vecptr++ = mrpsptr->CacheGuardSeconds; } if (mrpsptr->CacheMaxKBytes) { strcat (FaoString, " cache=max=!UL"); if (mrpsptr->CacheMaxKBytes == -1) *vecptr++ = 0; else *vecptr++ = mrpsptr->CacheMaxKBytes; } if (mrpsptr->CgiPlusInNoWriteof) strcat (FaoString, " cgiplusin=NOeof"); else if (mrpsptr->CgiPlusInWriteof) strcat (FaoString, " cgiplusin=EOF"); if (mrpsptr->CgiPlusInCC[0] || mrpsptr->CgiPlusInCC[1]) { if (mrpsptr->CgiPlusInCC[0] == '\r' && mrpsptr->CgiPlusInCC[1] == '\n') strcat (FaoString, " cgiplusin=cc=CRLF"); else if (mrpsptr->CgiPlusInCC[0] == '\n') strcat (FaoString, " cgiplusin=cc=LF"); else if (mrpsptr->CgiPlusInCC[0] == '\r') strcat (FaoString, " cgiplusin=cc=CR"); else strcat (FaoString, " cgiplusin=cc=NONE"); } if (mrpsptr->CgiPrefixPtr) { strcat (FaoString, " CGI=prefix=!AZ"); *vecptr++ = mrpsptr->CgiPrefixPtr; } if (mrpsptr->CgiVarPtr) { strcat (FaoString, " CGI=var=!AZ"); *vecptr++ = mrpsptr->CgiVarPtr; } if (mrpsptr->CharsetPtr) { strcat (FaoString, " charset=!&\"AZ"); *vecptr++ = mrpsptr->CharsetPtr; } if (mrpsptr->ClientAddress == MAPURL_CLIENT_FORWARDED) strcat (FaoString, " client=FORWARDED"); else if (mrpsptr->ClientAddress == MAPURL_CLIENT_IF_FORWARDED) strcat (FaoString, " client=IF=FORWARDED"); else if (mrpsptr->ClientAddress == MAPURL_CLIENT_IF_XFORWARDEDFOR) strcat (FaoString, " client=IF=XFORWARDEDFOR"); else if (mrpsptr->ClientAddress == MAPURL_CLIENT_LITERAL) { strcat (FaoString, " client=LITERAL=\"!AZ\""); *vecptr++ = mrpsptr->ClientAddressLiteralPtr; } else if (mrpsptr->ClientAddress == MAPURL_CLIENT_RESET) strcat (FaoString, " client=RESET"); else if (mrpsptr->ClientAddress == MAPURL_CLIENT_XFORWARDEDFOR) strcat (FaoString, " client=XFORWARDEDFOR"); if (mrpsptr->ContentTypePtr) { strcat (FaoString, " content=!&\"AZ"); *vecptr++ = mrpsptr->ContentTypePtr; } if (mrpsptr->CorsMaxAge) { strcat (FaoString, " cors=AGE=!UL"); *vecptr++ = mrpsptr->CorsMaxAge; } if (mrpsptr->CorsAllowCredentials) strcat (FaoString, " cors=CRED=true"); else if (mrpsptr->CorsNoAllowCredentials) strcat (FaoString, " cors=CRED=false"); if (mrpsptr->CorsExposeHeadersPtr) { strcat (FaoString, " cors=EXPOSE=!&\"AZ"); *vecptr++ = mrpsptr->CorsExposeHeadersPtr; } if (mrpsptr->CorsAllowHeadersPtr) { strcat (FaoString, " cors=HEADERS=!&\"AZ"); *vecptr++ = mrpsptr->CorsAllowHeadersPtr; } if (mrpsptr->CorsAllowMethodsPtr) { strcat (FaoString, " cors=METHODS=!&\"AZ"); *vecptr++ = mrpsptr->CorsAllowMethodsPtr; } if (mrpsptr->CorsAllowOriginPtr) { strcat (FaoString, " cors=ORIGIN=!&\"AZ"); *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) { strcat (FaoString, " dict=!&\"AZ"); *vecptr++ = mrpsptr->DictionaryPtr; } if (mrpsptr->DirNoAccess) strcat (FaoString, " dir=NOaccess"); else if (mrpsptr->DirAccess) strcat (FaoString, " dir=access"); else if (mrpsptr->DirAccessSelective) strcat (FaoString, " dir=access=selective"); if (mrpsptr->DirCharsetPtr) { strcat (FaoString, " dir=charset=!&\"AZ"); *vecptr++ = mrpsptr->DirCharsetPtr; } if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_BOTH) strcat (FaoString, " dir=DELIMIT=both"); else if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_HEADER) strcat (FaoString, " dir=DELIMIT=header"); else if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_FOOTER) strcat (FaoString, " dir=DELIMIT=footer"); else if (mrpsptr->DirDelimit == MAPURL_DIR_DELIMIT_NONE) strcat (FaoString, " dir=DELIMIT=none"); if (mrpsptr->DirFont == MAPURL_DIR_FONT_INHERIT) strcat (FaoString, " dir=FONT=inherit"); else if (mrpsptr->DirFont == MAPURL_DIR_FONT_MONOSPACE) strcat (FaoString, " dir=FONT=monospace"); if (mrpsptr->DirNoIconLink) strcat (FaoString, " dir=NOilink"); else if (mrpsptr->DirIconLink) strcat (FaoString, " dir=ilink"); if (mrpsptr->DirNoImpliedWildcard) strcat (FaoString, " dir=NOimpliedwildcard"); else if (mrpsptr->DirImpliedWildcard) strcat (FaoString, " dir=impliedwildcard"); if (mrpsptr->DirSort[0]) { strcat (FaoString, " dir=SORT=!AZ"); *vecptr++ = mrpsptr->DirSort; } if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_DEFAULT) strcat (FaoString, " dir=style=default"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_DEFAULT2) strcat (FaoString, " dir=style=default2"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ANCHOR) strcat (FaoString, " dir=style=anchor"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ANCHOR2) strcat (FaoString, " dir=style=anchor2"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_HTDIR) strcat (FaoString, " dir=style=htdir"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_HTDIR2) strcat (FaoString, " dir=style=htdir2"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ORIGINAL) strcat (FaoString, " dir=style=original"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_ORIGINAL2) strcat (FaoString, " dir=style=original2"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_SORT) strcat (FaoString, " dir=style=sort"); else if (mrpsptr->DirStyle == MAPURL_DIR_STYLE_SORT2) strcat (FaoString, " dir=style=sort2"); if (mrpsptr->DirTargetPtr) { strcat (FaoString, " dir=TARGET=\"!AZ\""); *vecptr++ = mrpsptr->DirTargetPtr; } if (mrpsptr->DirThesePtr) { strcat (FaoString, " dir=THESE=\"!AZ\""); *vecptr++ = mrpsptr->DirThesePtr; } if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_THIS) { strcat (FaoString, " dir=TITLE=this=\"!AZ\""); *vecptr++ = mrpsptr->DirTitlePtr; } else if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_DEFAULT) strcat (FaoString, " dir=TITLE=default"); else if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_OWNER) strcat (FaoString, " dir=TITLE=owner"); else if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_REMOTE) strcat (FaoString, " dir=TITLE=remote"); else if (mrpsptr->DirTitle == MAPURL_DIR_TITLE_NONE) strcat (FaoString, " dir=TITLE=0"); else if (mrpsptr->DirTitle) { strcat (FaoString, " dir=TITLE=!UL"); *vecptr++ = mrpsptr->DirTitle; } if (mrpsptr->DirVersionsOf) { if (mrpsptr->DirVersionsOf == 65536) strcat (FaoString, " dir=VERSIONS=*"); else if (mrpsptr->DirVersionsOf == -1) strcat (FaoString, " dir=VERSIONS=0"); else { strcat (FaoString, " dir=VERSIONS=!UL"); *vecptr++ = mrpsptr->DirVersionsOf; } } if (mrpsptr->DirNoWildcard) strcat (FaoString, " dir=NOwildcard"); else if (mrpsptr->DirWildcard) strcat (FaoString, " dir=wildcard"); if (mrpsptr->NoExpired) strcat (FaoString, " NOexpired"); else if (mrpsptr->Expired) strcat (FaoString, " expired"); if (mrpsptr->Http2ToHttp11) strcat (FaoString, " HTTP2=protocol=1.1"); if (mrpsptr->Http2MaxStreams) { strcat (FaoString, " HTTP2=streams=max=!UL"); *vecptr++ = mrpsptr->Http2MaxStreams; } if (mrpsptr->Http2WriteQueue == HTTP2_WRITE_QUEUE_HIGH) strcat (FaoString, " HTTP2=write=high"); else if (mrpsptr->Http2WriteQueue == HTTP2_WRITE_QUEUE_NORMAL) strcat (FaoString, " HTTP2=write=normal"); else if (mrpsptr->Http2WriteQueue == HTTP2_WRITE_QUEUE_LOW) strcat (FaoString, " HTTP2=write=low"); if (mrpsptr->Http2SendGoAway) { strcat (FaoString, " HTTP2=send=goaway=!UL"); *vecptr++ = mrpsptr->Http2SendGoAway - 1; } if (mrpsptr->Http2SendPing) strcat (FaoString, " HTTP2=send=ping"); if (mrpsptr->Http2SendReset) { strcat (FaoString, " HTTP2=send=reset=!UL"); *vecptr++ = mrpsptr->Http2SendReset - 1; } if (mrpsptr->HttpAcceptCharsetPtr) { strcat (FaoString, " http=Accept-Charset=!&\"AZ"); *vecptr++ = mrpsptr->HttpAcceptCharsetPtr; } if (mrpsptr->HtmlBodyTagPtr) { strcat (FaoString, " html=bodytag=!&\"AZ"); *vecptr++ = mrpsptr->HtmlBodyTagPtr; } if (mrpsptr->HtmlHeaderTagPtr) { strcat (FaoString, " html=headertag=!&\"AZ"); *vecptr++ = mrpsptr->HtmlHeaderTagPtr; } if (mrpsptr->HtmlHeaderPtr) { strcat (FaoString, " html=header=!&\"AZ"); *vecptr++ = mrpsptr->HtmlHeaderPtr; } if (mrpsptr->HtmlFooterTagPtr) { strcat (FaoString, " html=footertag=!&\"AZ"); *vecptr++ = mrpsptr->HtmlFooterTagPtr; } if (mrpsptr->HtmlFooterPtr) { strcat (FaoString, " html=footer=!&\"AZ"); *vecptr++ = mrpsptr->HtmlFooterPtr; } if (mrpsptr->HttpAcceptLangPtr) { strcat (FaoString, " http=Accept-Language=!&\"AZ"); *vecptr++ = mrpsptr->HttpAcceptLangPtr; } if (mrpsptr->IndexPtr) { strcat (FaoString, " index=!AZ"); *vecptr++ = mrpsptr->IndexPtr; } if (mrpsptr->NoLog) strcat (FaoString, " NOlog"); else if (mrpsptr->Log) strcat (FaoString, " log"); 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) strcat (FaoString, " map=NOELLIPSIS"); else if (mrpsptr->MapEllipsis) strcat (FaoString, " map=ELLIPSIS"); if (mrpsptr->MapNonEmpty) strcat (FaoString, " map=NOEMPTY"); else if (mrpsptr->MapEmpty) strcat (FaoString, " map=EMPTY"); if (mrpsptr->NoMapExtensionMethod) strcat (FaoString, " map=NOMETHOD"); else if (mrpsptr->MapExtensionMethod) strcat (FaoString, " map=METHOD"); if (mrpsptr->NoMapOnce) strcat (FaoString, " map=NOONCE"); else if (mrpsptr->MapOnce) strcat (FaoString, " map=ONCE"); if (mrpsptr->MapRestart) strcat (FaoString, " map=RESTART"); if (mrpsptr->MapSetNoIgnore) strcat (FaoString, " map=SET=noignore"); else if (mrpsptr->MapSetIgnore) strcat (FaoString, " map=SET=ignore"); if (mrpsptr->MapSetNoRequest) strcat (FaoString, " map=SET=norequest"); else if (mrpsptr->MapSetRequest) strcat (FaoString, " map=SET=request"); if (mrpsptr->MapUri) strcat (FaoString, " map=URI"); if (mrpsptr->MapRootPtr) { strcat (FaoString, " map=ROOT=!AZ"); *vecptr++ = mrpsptr->MapRootPtr; } if (mrpsptr->NoOp) strcat (FaoString, " NOOP"); if (mrpsptr->NotePadPtr) { strcat (FaoString, " notepad=!&\"AZ"); *vecptr++ = mrpsptr->NotePadPtr; } if (mrpsptr->PathOds == MAPURL_PATH_ODS_0) strcat (FaoString, " NOods"); else if (mrpsptr->PathOds == MAPURL_PATH_ODS_2) strcat (FaoString, " ods=2"); else if (mrpsptr->PathOds == MAPURL_PATH_ODS_5) strcat (FaoString, " ods=5"); else if (mrpsptr->PathOds == MAPURL_PATH_ODS_ADS) strcat (FaoString, " ods=ADS"); else if (mrpsptr->PathOds == MAPURL_PATH_ODS_PWK) strcat (FaoString, " ods=PWK"); else if (mrpsptr->PathOds == MAPURL_PATH_ODS_SMB) strcat (FaoString, " ods=SMB"); else if (mrpsptr->PathOds == MAPURL_PATH_ODS_SRI) strcat (FaoString, " ods=SRI"); if (mrpsptr->OdsName == MAPURL_ODS_8BIT) strcat (FaoString, " ods=name=8BIT"); else if (mrpsptr->OdsName == MAPURL_ODS_UTF8) strcat (FaoString, " ods=name=UTF8"); else if (mrpsptr->OdsName == MAPURL_ODS_DEFAULT) strcat (FaoString, " ods=name=DEFAULT"); if (mrpsptr->NoProfile) strcat (FaoString, " NOprofile"); else if (mrpsptr->Profile) strcat (FaoString, " profile"); if (mrpsptr->ProxyNoAffinity) strcat (FaoString, " proxy=NOAFFINITY"); else if (mrpsptr->ProxyAffinity) strcat (FaoString, " proxy=AFFINITY"); if (mrpsptr->ProxyBindIpAddressPtr) { strcat (FaoString, " proxy=BIND=!AZ"); *vecptr++ = mrpsptr->ProxyBindIpAddressPtr; } if (mrpsptr->ProxyChainHostPortPtr) { strcat (FaoString, " proxy=CHAIN=!AZ"); *vecptr++ = mrpsptr->ProxyChainHostPortPtr; } if (mrpsptr->ProxyChainCredPtr) { strcat (FaoString, " proxy=CHAIN=CRED=!AZ"); *vecptr++ = mrpsptr->ProxyChainCredPtr; } if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_NONE) strcat (FaoString, " proxy=NOforwarded"); else if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_BY) strcat (FaoString, " proxy=FORWARDED=by"); else if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_FOR) strcat (FaoString, " proxy=FORWARDED=for"); else if (mrpsptr->ProxyForwardedBy == PROXY_FORWARDED_ADDRESS) strcat (FaoString, " proxy=FORWARDED=address"); if (mrpsptr->ProxyReverseLocationLength) { strcat (FaoString, " proxy=REVERSE=location=!AZ"); *vecptr++ = mrpsptr->ProxyReverseLocationPtr; } if (mrpsptr->ProxyReworkLength) { strcat (FaoString, " proxy=REWORK=!AZ"); *vecptr++ = mrpsptr->ProxyReworkPtr; } if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_NONE) strcat (FaoString, " proxy=NOxforwardedfor"); else if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_ENABLED) strcat (FaoString, " proxy=XFORWARDEDFOR=enabled"); else if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_ADDRESS) strcat (FaoString, " proxy=XFORWARDEDFOR=address"); else if (mrpsptr->ProxyXForwardedFor == PROXY_XFORWARDEDFOR_UNKNOWN) strcat (FaoString, " proxy=XFORWARDEDFOR=unknown"); if (mrpsptr->NoProxyReverseVerify) strcat (FaoString, " proxy=REVERSE=NOverify"); else if (mrpsptr->ProxyReverseVerify) strcat (FaoString, " proxy=REVERSE=verify"); if (mrpsptr->NoProxyReverseAuthHeader) strcat (FaoString, " proxy=REVERSE=NOauth"); else if (mrpsptr->ProxyReverseAuthHeader) strcat (FaoString, " proxy=REVERSE=auth"); if (mrpsptr->ProxyTunnelRequestPtr) { strcat (FaoString, " proxy=tunnel=request=!&\\&\"AZ"); *vecptr++ = mrpsptr->ProxyTunnelRequestPtr; } if (mrpsptr->NoProxyUnknownRequestFields) strcat (FaoString, " proxy=NOUNKNOWN"); else if (mrpsptr->ProxyUnknownRequestFields) strcat (FaoString, " proxy=UNKNOWN"); 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) strcat (FaoString, " put=FIX512"); else if (mrpsptr->PutRFM == PUT_RFM_STM) strcat (FaoString, " put=STM"); else if (mrpsptr->PutRFM == PUT_RFM_STMCR) strcat (FaoString, " put=STMCR"); else if (mrpsptr->PutRFM == PUT_RFM_STMLF) strcat (FaoString, " put=STMLF"); else if (mrpsptr->PutRFM == PUT_RFM_UDF) strcat (FaoString, " put=UDF"); if (mrpsptr->PutMaxKbytes) { strcat (FaoString, " put=MAX=!UL"); *vecptr++ = mrpsptr->PutMaxKbytes; } if (mrpsptr->RegexSyntax) { strcat (FaoString, " regex=!AZ"); 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) strcat (FaoString, " report=BASIC"); else if (mrpsptr->ReportType == ERROR_REPORT_DETAILED) strcat (FaoString, " report=DETAILED"); else if (mrpsptr->ReportType == ERROR_REPORT_TUNNEL) strcat (FaoString, " report=TUNNEL"); if (mrpsptr->Report400as) { strcat (FaoString, " report=400=!UL"); *vecptr++ = mrpsptr->Report400as; } if (mrpsptr->Report403as) { strcat (FaoString, " report=403=!UL"); *vecptr++ = mrpsptr->Report403as; } if (mrpsptr->Report404as) { strcat (FaoString, " report=404=!UL"); *vecptr++ = mrpsptr->Report404as; } if (mrpsptr->Response200is203 == 203) strcat (FaoString, " response=200=203"); else if (mrpsptr->Response200is203 == 200) strcat (FaoString, " response=203=200"); if (mrpsptr->ResponseGzip == MAPURL_RESPONSE_GZIP_ALL) strcat (FaoString, " response=GZIP=all"); else if (mrpsptr->ResponseGzip == MAPURL_RESPONSE_GZIP_NONE) strcat (FaoString, " response=GZIP=none"); else if (mrpsptr->ResponseGzip) { strcat (FaoString, " response=GZIP=!UL"); *vecptr++ = mrpsptr->ResponseGzip; } if (mrpsptr->ResponseNoChunked) strcat (FaoString, " response=NOchunked"); else if (mrpsptr->ResponseChunked) strcat (FaoString, " response=chunked"); if (mrpsptr->ResponseCspLength) { if (mrpsptr->ResponseCspLength < 0) strcat (FaoString, " response=NOcsp"); else { strcat (FaoString, " response=csp=!&\"AZ"); *vecptr++ = mrpsptr->ResponseCspPtr; } } if (mrpsptr->ResponseCsproLength) { if (mrpsptr->ResponseCsproLength < 0) strcat (FaoString, " response=NOcspro"); else { strcat (FaoString, " response=cspro=!&\"AZ"); *vecptr++ = mrpsptr->ResponseCsproPtr; } } if (mrpsptr->ResponseHeaderNone) strcat (FaoString, " response=header=none"); else if (mrpsptr->ResponseHeaderBegin) strcat (FaoString, " response=header=begin"); else if (mrpsptr->ResponseHeaderFull) strcat (FaoString, " response=header=full"); if (mrpsptr->ResponseHeaderNoAdd) strcat (FaoString, " response=header=NOadd"); if (mrpsptr->ResponseHeaderAddLength) { strcat (FaoString, " response=header=add=!&\"AZ"); *vecptr++ = mrpsptr->ResponseHeaderAddPtr; } if (mrpsptr->ResponseHttpNoOriginal) strcat (FaoString, " response=HTTP=NOoriginal"); else if (mrpsptr->ResponseHttpOriginal) strcat (FaoString, " response=HTTP=original"); if (mrpsptr->ResponseStrictTransSecPtr) { strcat (FaoString, " response=STS=\"!AZ\""); *vecptr++ = mrpsptr->ResponseStrictTransSecPtr; } if (mrpsptr->ResponseVarRecord == FILE_VAR_ASIS) strcat (FaoString, " response=VAR=ASIS"); else if (mrpsptr->ResponseVarRecord == FILE_VAR_CRLF) strcat (FaoString, " response=VAR=CRLF"); else if (mrpsptr->ResponseVarRecord == FILE_VAR_LF) strcat (FaoString, " response=VAR=LF"); else if (mrpsptr->ResponseVarRecord == FILE_VAR_NONE) strcat (FaoString, " response=VAR=NONE"); 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) strcat (FaoString, " script=BODY=NOdecode"); else if (mrpsptr->ScriptBodyDecode) strcat (FaoString, " script=BODY=decode"); if (mrpsptr->ScriptSymbolNoTruncate) strcat (FaoString, " script=SYMBOL=NOtruncate"); else if (mrpsptr->ScriptSymbolTruncate) strcat (FaoString, " script=SYMBOL=truncate"); if (mrpsptr->ScriptSyntaxNoUnix) strcat (FaoString, " script=SYNTAX=NOunix"); else if (mrpsptr->ScriptSyntaxUnix) strcat (FaoString, " script=SYNTAX=unix"); if (mrpsptr->ScriptNoFind) strcat (FaoString, " script=NOfind"); else if (mrpsptr->ScriptFind) strcat (FaoString, " script=FIND"); if (mrpsptr->ScriptNoPathFind) strcat (FaoString, " NOscript=PATH=find"); else if (mrpsptr->ScriptPathFind) strcat (FaoString, " script=PATH=find"); if (mrpsptr->ScriptNoQueryNone) strcat (FaoString, " NOscript=QUERY=none"); else if (mrpsptr->ScriptQueryNone) strcat (FaoString, " script=QUERY=none"); if (mrpsptr->ScriptNoQueryRelaxed) strcat (FaoString, " NOscript=QUERY=relaxed"); else if (mrpsptr->ScriptQueryRelaxed) strcat (FaoString, " script=QUERY=relaxed"); if (mrpsptr->NoDefaultSearch) strcat (FaoString, " search=none"); else if (mrpsptr->DefaultSearch) strcat (FaoString, " NOsearch=none"); if (mrpsptr->ChangeServicePtr) { strcat (FaoString, " service=!AZ"); *vecptr++ = mrpsptr->ChangeServicePtr; } if (mrpsptr->NoPrivSsi) strcat (FaoString, " NOssi=PRIV"); else if (mrpsptr->PrivSsi) strcat (FaoString, " ssi=PRIV"); if (mrpsptr->SsiExecPtr) { strcat (FaoString, " ssi=EXEC=!AZ"); *vecptr++ = mrpsptr->SsiExecPtr; } if (mrpsptr->StyleSheetPtr) { strcat (FaoString, " css=!AZ"); *vecptr++ = mrpsptr->StyleSheetPtr; } if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL) strcat (FaoString, " SSLCGI=Apache_mod_SSL"); else if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL_CLIENT) strcat (FaoString, " SSLCGI=Apache_mod_SSL_client"); else if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL_EXTENS) strcat (FaoString, " SSLCGI=Apache_mod_SSL_extens"); else if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_APACHE_MOD_SSL_OID) strcat (FaoString, " SSLCGI=Apache_mod_SSL_OID"); else if (mrpsptr->SSLCGIvar == SESOLA_CGI_VAR_PURVEYOR) strcat (FaoString, " SSLCGI=Purveyor"); if (mrpsptr->NoStmLF) strcat (FaoString, " NOstmLF"); else if (mrpsptr->StmLF) strcat (FaoString, " stmLF"); 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) { strcat (FaoString, " query-string=!&\"AZ"); *vecptr++ = mrpsptr->QueryStringPtr; } if (mrpsptr->RmsSubChar) { strcat (FaoString, " RMSchar=!&C"); *vecptr++ = mrpsptr->RmsSubChar; } if (mrpsptr->ScriptAgentAsPtr) { strcat (FaoString, " script=AGENT=AS=!AZ"); *vecptr++ = mrpsptr->ScriptAgentAsPtr; } if (mrpsptr->ScriptAsPtr) { strcat (FaoString, " script=AS=!AZ"); *vecptr++ = mrpsptr->ScriptAsPtr; } if (mrpsptr->ScriptCommandPtr) { strcat (FaoString, " script=COMMAND=!&\"AZ"); *vecptr++ = mrpsptr->ScriptCommandPtr; } if (mrpsptr->ScriptControlPtr) { strcat (FaoString, " script=CONTROL=!&\"AZ"); *vecptr++ = mrpsptr->ScriptControlPtr; } if (mrpsptr->ScriptDefaultPtr) { strcat (FaoString, " script=DEFAULT=!AZ"); *vecptr++ = mrpsptr->ScriptDefaultPtr; } if (mrpsptr->ScriptBitBucketTimeout) { strcat (FaoString, " script=BIT-BUCKET=!AZ"); *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->ScriptBitBucketTimeout); } if (mrpsptr->ScriptCpuMax) { strcat (FaoString, " script=CPU=!UL"); *vecptr++ = mrpsptr->ScriptCpuMax; } if (mrpsptr->ScriptLifeTime) { strcat (FaoString, " script=lifetime=!AZ"); *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->ScriptLifeTime); } if (mrpsptr->ScriptParamsPtr) { strcat (FaoString, " script=PARAMS=!&\"AZ"); *vecptr++ = mrpsptr->ScriptParamsPtr; } if (mrpsptr->TimeoutPersistent > 0 || mrpsptr->TimeoutNoProgress > 0 || mrpsptr->TimeoutOutput > 0) { strcat (FaoString, " timeout=!AZ(p),!AZ(np),!AZ(o)"); *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) strcat (FaoString, " notimeout"); if (mrpsptr->ThrottleNoSet) strcat (FaoString, " throttle=NONE"); else if (mrpsptr->ThrottleSet) { if (mrpsptr->ThrottlePerUser) { strcat (FaoString, " throttle=!UL$!UL,!UL,!UL,!UL,!AZ,!AZ"); *vecptr++ = mrpsptr->ThrottleFrom; *vecptr++ = mrpsptr->ThrottlePerUser; } else { strcat (FaoString, " throttle=!UL,!UL,!UL,!UL,!AZ,!AZ"); *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) strcat (FaoString, " access=NOprofile"); else if (mrpsptr->AccessProfile) strcat (FaoString, " access=profile"); if (mrpsptr->AccessNoRead) strcat (FaoString, " access=NOread"); else if (mrpsptr->AccessRead) strcat (FaoString, " access=read"); if (mrpsptr->AccessNoServer) strcat (FaoString, " access=NOserver"); else if (mrpsptr->AccessServer) strcat (FaoString, " access=server"); if (mrpsptr->AccessNoWrite) strcat (FaoString, " access=NOwrite"); else if (mrpsptr->AccessWrite) strcat (FaoString, " access=write"); 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) strcat (FaoString, " WebDAV=NOall"); else if (mrpsptr->WebDavAll) strcat (FaoString, " WebDAV=all"); if (mrpsptr->WebDavNoAuth) strcat (FaoString, " WebDAV=NOauth"); else if (mrpsptr->WebDavAuth) strcat (FaoString, " WebDAV=auth"); if (mrpsptr->WebDavNoServer) strcat (FaoString, " WebDAV=NOserver"); else if (mrpsptr->WebDavServer) strcat (FaoString, " WebDAV=server"); if (mrpsptr->WebDavNoHidden) strcat (FaoString, " WebDAV=NOhidden"); else if (mrpsptr->WebDavHidden) strcat (FaoString, " WebDAV=hidden"); if (mrpsptr->WebDavNoLock) strcat (FaoString, " WebDAV=NOlock"); else if (mrpsptr->WebDavLock) strcat (FaoString, " WebDAV=lock"); if (mrpsptr->WebDavMetaDirPtr) { strcat (FaoString, " webdav=META=dir=!&\"AZ"); *vecptr++ = mrpsptr->WebDavMetaDirPtr; } if (mrpsptr->WebDavNoProfile) strcat (FaoString, " WebDAV=NOprofile"); else if (mrpsptr->WebDavProfile) strcat (FaoString, " WebDAV=profile"); if (mrpsptr->WebDavNoProp) strcat (FaoString, " WebDAV=NOprop"); else if (mrpsptr->WebDavProp) strcat (FaoString, " WebDAV=prop"); if (mrpsptr->WebDavNoPutLock) strcat (FaoString, " WebDAV=NOPUT=lock"); else if (mrpsptr->WebDavPutLock) strcat (FaoString, " WebDAV=PUT=lock"); if (mrpsptr->WebDavNoRead) strcat (FaoString, " WebDAV=NOread"); else if (mrpsptr->WebDavRead) strcat (FaoString, " WebDAV=read"); if (mrpsptr->WebDavNoWinProp) strcat (FaoString, " WebDAV=NOwinprop"); else if (mrpsptr->WebDavWinProp) strcat (FaoString, " WebDAV=winprop"); if (mrpsptr->WebDavNoWrite) strcat (FaoString, " WebDAV=NOwrite"); else if (mrpsptr->WebDavWrite) strcat (FaoString, " WebDAV=write"); if (mrpsptr->WebDavLockTimeoutDefault) { strcat (FaoString, " WebDAV=lock=timeout=default=!AZ"); *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->WebDavLockTimeoutDefault); } if (mrpsptr->WebDavLockTimeoutMax) { strcat (FaoString, " WebDAV=lock=timeout=max=!AZ"); *vecptr++ = MetaConShowSeconds (rqptr, mrpsptr->WebDavLockTimeoutMax); } if (mrpsptr->WebSocketInputSize) { strcat (FaoString, " WebSocket=input=!UL"); *vecptr++ = mrpsptr->WebSocketInputSize; } if (mrpsptr->WebSocketOutputSize) { strcat (FaoString, " WebSocket=output=!UL"); *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); } /*****************************************************************************/