From: Francesco Chemolli Date: Mon, 5 Jan 2015 21:48:36 +0000 (+0100) Subject: Turn c++11 initializer lists into explicit constructors X-Git-Tag: merge-candidate-3-v1~371 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95cc1e3e146fd6e810b191c9719476333c9179da;p=thirdparty%2Fsquid.git Turn c++11 initializer lists into explicit constructors Only fairly recent versions of gcc and clang support well c++11-style initializer lists; reverting to traditional constructors obtains better portability at the price of less readable code. This changeset can be reverted after RHEL/CentOS 6, Debian Wheezy and Ubuntu Precise will not be supported anymore. --- diff --git a/src/HttpHdrCc.cc b/src/HttpHdrCc.cc index af09e78e12..ee343febc8 100644 --- a/src/HttpHdrCc.cc +++ b/src/HttpHdrCc.cc @@ -28,6 +28,7 @@ class HttpHeaderCcFields public: HttpHeaderCcFields() : name(NULL), id(CC_BADHDR), stat() {} HttpHeaderCcFields(const char *aName, http_hdr_cc_type aTypeId) : name(aName), id(aTypeId) {} + HttpHeaderCcFields(const HttpHeaderCcFields &f) : name(f.name), id(f.id) {} // nothing to do as name is a pointer to global static string ~HttpHeaderCcFields() {} @@ -36,26 +37,25 @@ public: HttpHeaderFieldStat stat; private: - HttpHeaderCcFields(const HttpHeaderCcFields &); // not implemented HttpHeaderCcFields &operator =(const HttpHeaderCcFields &); // not implemented }; /* order must match that of enum http_hdr_cc_type. The constraint is verified at initialization time */ static HttpHeaderCcFields CcAttrs[CC_ENUM_END] = { - {"public", CC_PUBLIC}, - {"private", CC_PRIVATE}, - {"no-cache", CC_NO_CACHE}, - {"no-store", CC_NO_STORE}, - {"no-transform", CC_NO_TRANSFORM}, - {"must-revalidate", CC_MUST_REVALIDATE}, - {"proxy-revalidate", CC_PROXY_REVALIDATE}, - {"max-age", CC_MAX_AGE}, - {"s-maxage", CC_S_MAXAGE}, - {"max-stale", CC_MAX_STALE}, - {"min-fresh", CC_MIN_FRESH}, - {"only-if-cached", CC_ONLY_IF_CACHED}, - {"stale-if-error", CC_STALE_IF_ERROR}, - {"Other,", CC_OTHER} /* ',' will protect from matches */ + HttpHeaderCcFields("public", CC_PUBLIC), + HttpHeaderCcFields("private", CC_PRIVATE), + HttpHeaderCcFields("no-cache", CC_NO_CACHE), + HttpHeaderCcFields("no-store", CC_NO_STORE), + HttpHeaderCcFields("no-transform", CC_NO_TRANSFORM), + HttpHeaderCcFields("must-revalidate", CC_MUST_REVALIDATE), + HttpHeaderCcFields("proxy-revalidate", CC_PROXY_REVALIDATE), + HttpHeaderCcFields("max-age", CC_MAX_AGE), + HttpHeaderCcFields("s-maxage", CC_S_MAXAGE), + HttpHeaderCcFields("max-stale", CC_MAX_STALE), + HttpHeaderCcFields("min-fresh", CC_MIN_FRESH), + HttpHeaderCcFields("only-if-cached", CC_ONLY_IF_CACHED), + HttpHeaderCcFields("stale-if-error", CC_STALE_IF_ERROR), + HttpHeaderCcFields("Other,", CC_OTHER) /* ',' will protect from matches */ }; /// Map an header name to its type, to expedite parsing diff --git a/src/HttpHdrSc.cc b/src/HttpHdrSc.cc index f23014b65a..7f53a5f4bd 100644 --- a/src/HttpHdrSc.cc +++ b/src/HttpHdrSc.cc @@ -32,11 +32,11 @@ typedef struct { /* order must match that of enum http_hdr_sc_type. The constraint is verified at initialization time */ //todo: implement constraint static const HttpHeaderFieldAttrs ScAttrs[SC_ENUM_END] = { - {"no-store", (http_hdr_type)SC_NO_STORE}, - {"no-store-remote", (http_hdr_type)SC_NO_STORE_REMOTE}, - {"max-age", (http_hdr_type)SC_MAX_AGE}, - {"content", (http_hdr_type)SC_CONTENT}, - {"Other,", (http_hdr_type)SC_OTHER} /* ',' will protect from matches */ + HttpHeaderFieldAttrs("no-store", (http_hdr_type)SC_NO_STORE), + HttpHeaderFieldAttrs("no-store-remote", (http_hdr_type)SC_NO_STORE_REMOTE), + HttpHeaderFieldAttrs("max-age", (http_hdr_type)SC_MAX_AGE), + HttpHeaderFieldAttrs("content", (http_hdr_type)SC_CONTENT), + HttpHeaderFieldAttrs("Other,", (http_hdr_type)SC_OTHER) /* ',' will protect from matches */ }; HttpHeaderFieldInfo *ScFieldsInfo = NULL; diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 59dad66fc8..6d5d3aba7b 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -65,98 +65,98 @@ * After reorganization, field id can be used as an index to the table. */ static const HttpHeaderFieldAttrs HeadersAttrs[] = { - {"Accept", HDR_ACCEPT, ftStr}, - - {"Accept-Charset", HDR_ACCEPT_CHARSET, ftStr}, - {"Accept-Encoding", HDR_ACCEPT_ENCODING, ftStr}, - {"Accept-Language", HDR_ACCEPT_LANGUAGE, ftStr}, - {"Accept-Ranges", HDR_ACCEPT_RANGES, ftStr}, - {"Age", HDR_AGE, ftInt}, - {"Allow", HDR_ALLOW, ftStr}, - {"Alternate-Protocol", HDR_ALTERNATE_PROTOCOL, ftStr}, - {"Authorization", HDR_AUTHORIZATION, ftStr}, /* for now */ - {"Cache-Control", HDR_CACHE_CONTROL, ftPCc}, - {"Connection", HDR_CONNECTION, ftStr}, - {"Content-Base", HDR_CONTENT_BASE, ftStr}, - {"Content-Disposition", HDR_CONTENT_DISPOSITION, ftStr}, /* for now */ - {"Content-Encoding", HDR_CONTENT_ENCODING, ftStr}, - {"Content-Language", HDR_CONTENT_LANGUAGE, ftStr}, - {"Content-Length", HDR_CONTENT_LENGTH, ftInt64}, - {"Content-Location", HDR_CONTENT_LOCATION, ftStr}, - {"Content-MD5", HDR_CONTENT_MD5, ftStr}, /* for now */ - {"Content-Range", HDR_CONTENT_RANGE, ftPContRange}, - {"Content-Type", HDR_CONTENT_TYPE, ftStr}, - {"Cookie", HDR_COOKIE, ftStr}, - {"Cookie2", HDR_COOKIE2, ftStr}, - {"Date", HDR_DATE, ftDate_1123}, - {"ETag", HDR_ETAG, ftETag}, - {"Expect", HDR_EXPECT, ftStr}, - {"Expires", HDR_EXPIRES, ftDate_1123}, - {"Forwarded", HDR_FORWARDED, ftStr}, - {"From", HDR_FROM, ftStr}, - {"Host", HDR_HOST, ftStr}, - {"HTTP2-Settings", HDR_HTTP2_SETTINGS, ftStr}, /* for now */ - {"If-Match", HDR_IF_MATCH, ftStr}, /* for now */ - {"If-Modified-Since", HDR_IF_MODIFIED_SINCE, ftDate_1123}, - {"If-None-Match", HDR_IF_NONE_MATCH, ftStr}, /* for now */ - {"If-Range", HDR_IF_RANGE, ftDate_1123_or_ETag}, - {"If-Unmodified-Since", HDR_IF_UNMODIFIED_SINCE, ftDate_1123}, - {"Keep-Alive", HDR_KEEP_ALIVE, ftStr}, - {"Key", HDR_KEY, ftStr}, - {"Last-Modified", HDR_LAST_MODIFIED, ftDate_1123}, - {"Link", HDR_LINK, ftStr}, - {"Location", HDR_LOCATION, ftStr}, - {"Max-Forwards", HDR_MAX_FORWARDS, ftInt64}, - {"Mime-Version", HDR_MIME_VERSION, ftStr}, /* for now */ - {"Negotiate", HDR_NEGOTIATE, ftStr}, - {"Origin", HDR_ORIGIN, ftStr}, - {"Pragma", HDR_PRAGMA, ftStr}, - {"Proxy-Authenticate", HDR_PROXY_AUTHENTICATE, ftStr}, - {"Proxy-Authentication-Info", HDR_PROXY_AUTHENTICATION_INFO, ftStr}, - {"Proxy-Authorization", HDR_PROXY_AUTHORIZATION, ftStr}, - {"Proxy-Connection", HDR_PROXY_CONNECTION, ftStr}, - {"Proxy-support", HDR_PROXY_SUPPORT, ftStr}, - {"Public", HDR_PUBLIC, ftStr}, - {"Range", HDR_RANGE, ftPRange}, - {"Referer", HDR_REFERER, ftStr}, - {"Request-Range", HDR_REQUEST_RANGE, ftPRange}, /* usually matches HDR_RANGE */ - {"Retry-After", HDR_RETRY_AFTER, ftStr}, /* for now (ftDate_1123 or ftInt!) */ - {"Server", HDR_SERVER, ftStr}, - {"Set-Cookie", HDR_SET_COOKIE, ftStr}, - {"Set-Cookie2", HDR_SET_COOKIE2, ftStr}, - {"TE", HDR_TE, ftStr}, - {"Title", HDR_TITLE, ftStr}, - {"Trailer", HDR_TRAILER, ftStr}, - {"Transfer-Encoding", HDR_TRANSFER_ENCODING, ftStr}, - {"Translate", HDR_TRANSLATE, ftStr}, /* for now. may need to crop */ - {"Unless-Modified-Since", HDR_UNLESS_MODIFIED_SINCE, ftStr}, /* for now ignore. may need to crop */ - {"Upgrade", HDR_UPGRADE, ftStr}, /* for now */ - {"User-Agent", HDR_USER_AGENT, ftStr}, - {"Vary", HDR_VARY, ftStr}, /* for now */ - {"Via", HDR_VIA, ftStr}, /* for now */ - {"Warning", HDR_WARNING, ftStr}, /* for now */ - {"WWW-Authenticate", HDR_WWW_AUTHENTICATE, ftStr}, - {"Authentication-Info", HDR_AUTHENTICATION_INFO, ftStr}, - {"X-Cache", HDR_X_CACHE, ftStr}, - {"X-Cache-Lookup", HDR_X_CACHE_LOOKUP, ftStr}, - {"X-Forwarded-For", HDR_X_FORWARDED_FOR, ftStr}, - {"X-Request-URI", HDR_X_REQUEST_URI, ftStr}, - {"X-Squid-Error", HDR_X_SQUID_ERROR, ftStr}, + HttpHeaderFieldAttrs("Accept", HDR_ACCEPT, ftStr), + + HttpHeaderFieldAttrs("Accept-Charset", HDR_ACCEPT_CHARSET, ftStr), + HttpHeaderFieldAttrs("Accept-Encoding", HDR_ACCEPT_ENCODING, ftStr), + HttpHeaderFieldAttrs("Accept-Language", HDR_ACCEPT_LANGUAGE, ftStr), + HttpHeaderFieldAttrs("Accept-Ranges", HDR_ACCEPT_RANGES, ftStr), + HttpHeaderFieldAttrs("Age", HDR_AGE, ftInt), + HttpHeaderFieldAttrs("Allow", HDR_ALLOW, ftStr), + HttpHeaderFieldAttrs("Alternate-Protocol", HDR_ALTERNATE_PROTOCOL, ftStr), + HttpHeaderFieldAttrs("Authorization", HDR_AUTHORIZATION, ftStr), /* for now */ + HttpHeaderFieldAttrs("Cache-Control", HDR_CACHE_CONTROL, ftPCc), + HttpHeaderFieldAttrs("Connection", HDR_CONNECTION, ftStr), + HttpHeaderFieldAttrs("Content-Base", HDR_CONTENT_BASE, ftStr), + HttpHeaderFieldAttrs("Content-Disposition", HDR_CONTENT_DISPOSITION, ftStr), /* for now */ + HttpHeaderFieldAttrs("Content-Encoding", HDR_CONTENT_ENCODING, ftStr), + HttpHeaderFieldAttrs("Content-Language", HDR_CONTENT_LANGUAGE, ftStr), + HttpHeaderFieldAttrs("Content-Length", HDR_CONTENT_LENGTH, ftInt64), + HttpHeaderFieldAttrs("Content-Location", HDR_CONTENT_LOCATION, ftStr), + HttpHeaderFieldAttrs("Content-MD5", HDR_CONTENT_MD5, ftStr), /* for now */ + HttpHeaderFieldAttrs("Content-Range", HDR_CONTENT_RANGE, ftPContRange), + HttpHeaderFieldAttrs("Content-Type", HDR_CONTENT_TYPE, ftStr), + HttpHeaderFieldAttrs("Cookie", HDR_COOKIE, ftStr), + HttpHeaderFieldAttrs("Cookie2", HDR_COOKIE2, ftStr), + HttpHeaderFieldAttrs("Date", HDR_DATE, ftDate_1123), + HttpHeaderFieldAttrs("ETag", HDR_ETAG, ftETag), + HttpHeaderFieldAttrs("Expect", HDR_EXPECT, ftStr), + HttpHeaderFieldAttrs("Expires", HDR_EXPIRES, ftDate_1123), + HttpHeaderFieldAttrs("Forwarded", HDR_FORWARDED, ftStr), + HttpHeaderFieldAttrs("From", HDR_FROM, ftStr), + HttpHeaderFieldAttrs("Host", HDR_HOST, ftStr), + HttpHeaderFieldAttrs("HTTP2-Settings", HDR_HTTP2_SETTINGS, ftStr), /* for now */ + HttpHeaderFieldAttrs("If-Match", HDR_IF_MATCH, ftStr), /* for now */ + HttpHeaderFieldAttrs("If-Modified-Since", HDR_IF_MODIFIED_SINCE, ftDate_1123), + HttpHeaderFieldAttrs("If-None-Match", HDR_IF_NONE_MATCH, ftStr), /* for now */ + HttpHeaderFieldAttrs("If-Range", HDR_IF_RANGE, ftDate_1123_or_ETag), + HttpHeaderFieldAttrs("If-Unmodified-Since", HDR_IF_UNMODIFIED_SINCE, ftDate_1123), + HttpHeaderFieldAttrs("Keep-Alive", HDR_KEEP_ALIVE, ftStr), + HttpHeaderFieldAttrs("Key", HDR_KEY, ftStr), + HttpHeaderFieldAttrs("Last-Modified", HDR_LAST_MODIFIED, ftDate_1123), + HttpHeaderFieldAttrs("Link", HDR_LINK, ftStr), + HttpHeaderFieldAttrs("Location", HDR_LOCATION, ftStr), + HttpHeaderFieldAttrs("Max-Forwards", HDR_MAX_FORWARDS, ftInt64), + HttpHeaderFieldAttrs("Mime-Version", HDR_MIME_VERSION, ftStr), /* for now */ + HttpHeaderFieldAttrs("Negotiate", HDR_NEGOTIATE, ftStr), + HttpHeaderFieldAttrs("Origin", HDR_ORIGIN, ftStr), + HttpHeaderFieldAttrs("Pragma", HDR_PRAGMA, ftStr), + HttpHeaderFieldAttrs("Proxy-Authenticate", HDR_PROXY_AUTHENTICATE, ftStr), + HttpHeaderFieldAttrs("Proxy-Authentication-Info", HDR_PROXY_AUTHENTICATION_INFO, ftStr), + HttpHeaderFieldAttrs("Proxy-Authorization", HDR_PROXY_AUTHORIZATION, ftStr), + HttpHeaderFieldAttrs("Proxy-Connection", HDR_PROXY_CONNECTION, ftStr), + HttpHeaderFieldAttrs("Proxy-support", HDR_PROXY_SUPPORT, ftStr), + HttpHeaderFieldAttrs("Public", HDR_PUBLIC, ftStr), + HttpHeaderFieldAttrs("Range", HDR_RANGE, ftPRange), + HttpHeaderFieldAttrs("Referer", HDR_REFERER, ftStr), + HttpHeaderFieldAttrs("Request-Range", HDR_REQUEST_RANGE, ftPRange), /* usually matches HDR_RANGE */ + HttpHeaderFieldAttrs("Retry-After", HDR_RETRY_AFTER, ftStr), /* for now (ftDate_1123 or ftInt!) */ + HttpHeaderFieldAttrs("Server", HDR_SERVER, ftStr), + HttpHeaderFieldAttrs("Set-Cookie", HDR_SET_COOKIE, ftStr), + HttpHeaderFieldAttrs("Set-Cookie2", HDR_SET_COOKIE2, ftStr), + HttpHeaderFieldAttrs("TE", HDR_TE, ftStr), + HttpHeaderFieldAttrs("Title", HDR_TITLE, ftStr), + HttpHeaderFieldAttrs("Trailer", HDR_TRAILER, ftStr), + HttpHeaderFieldAttrs("Transfer-Encoding", HDR_TRANSFER_ENCODING, ftStr), + HttpHeaderFieldAttrs("Translate", HDR_TRANSLATE, ftStr), /* for now. may need to crop */ + HttpHeaderFieldAttrs("Unless-Modified-Since", HDR_UNLESS_MODIFIED_SINCE, ftStr), /* for now ignore. may need to crop */ + HttpHeaderFieldAttrs("Upgrade", HDR_UPGRADE, ftStr), /* for now */ + HttpHeaderFieldAttrs("User-Agent", HDR_USER_AGENT, ftStr), + HttpHeaderFieldAttrs("Vary", HDR_VARY, ftStr), /* for now */ + HttpHeaderFieldAttrs("Via", HDR_VIA, ftStr), /* for now */ + HttpHeaderFieldAttrs("Warning", HDR_WARNING, ftStr), /* for now */ + HttpHeaderFieldAttrs("WWW-Authenticate", HDR_WWW_AUTHENTICATE, ftStr), + HttpHeaderFieldAttrs("Authentication-Info", HDR_AUTHENTICATION_INFO, ftStr), + HttpHeaderFieldAttrs("X-Cache", HDR_X_CACHE, ftStr), + HttpHeaderFieldAttrs("X-Cache-Lookup", HDR_X_CACHE_LOOKUP, ftStr), + HttpHeaderFieldAttrs("X-Forwarded-For", HDR_X_FORWARDED_FOR, ftStr), + HttpHeaderFieldAttrs("X-Request-URI", HDR_X_REQUEST_URI, ftStr), + HttpHeaderFieldAttrs("X-Squid-Error", HDR_X_SQUID_ERROR, ftStr), #if X_ACCELERATOR_VARY - {"X-Accelerator-Vary", HDR_X_ACCELERATOR_VARY, ftStr}, + HttpHeaderFieldAttrs("X-Accelerator-Vary", HDR_X_ACCELERATOR_VARY, ftStr), #endif #if USE_ADAPTATION - {"X-Next-Services", HDR_X_NEXT_SERVICES, ftStr}, + HttpHeaderFieldAttrs("X-Next-Services", HDR_X_NEXT_SERVICES, ftStr), #endif - {"Surrogate-Capability", HDR_SURROGATE_CAPABILITY, ftStr}, - {"Surrogate-Control", HDR_SURROGATE_CONTROL, ftPSc}, - {"Front-End-Https", HDR_FRONT_END_HTTPS, ftStr}, - {"FTP-Command", HDR_FTP_COMMAND, ftStr}, - {"FTP-Arguments", HDR_FTP_ARGUMENTS, ftStr}, - {"FTP-Pre", HDR_FTP_PRE, ftStr}, - {"FTP-Status", HDR_FTP_STATUS, ftInt}, - {"FTP-Reason", HDR_FTP_REASON, ftStr}, - {"Other:", HDR_OTHER, ftStr} /* ':' will not allow matches */ + HttpHeaderFieldAttrs("Surrogate-Capability", HDR_SURROGATE_CAPABILITY, ftStr), + HttpHeaderFieldAttrs("Surrogate-Control", HDR_SURROGATE_CONTROL, ftPSc), + HttpHeaderFieldAttrs("Front-End-Https", HDR_FRONT_END_HTTPS, ftStr), + HttpHeaderFieldAttrs("FTP-Command", HDR_FTP_COMMAND, ftStr), + HttpHeaderFieldAttrs("FTP-Arguments", HDR_FTP_ARGUMENTS, ftStr), + HttpHeaderFieldAttrs("FTP-Pre", HDR_FTP_PRE, ftStr), + HttpHeaderFieldAttrs("FTP-Status", HDR_FTP_STATUS, ftInt), + HttpHeaderFieldAttrs("FTP-Reason", HDR_FTP_REASON, ftStr), + HttpHeaderFieldAttrs("Other:", HDR_OTHER, ftStr) /* ':' will not allow matches */ }; static HttpHeaderFieldInfo *Headers = NULL; @@ -324,12 +324,12 @@ static http_hdr_type HopByHopHeadersArr[] = { /* header accounting */ // NP: keep in sync with enum http_hdr_owner_type static HttpHeaderStat HttpHeaderStats[] = { - {/*hoNone*/ "all", NULL}, + HttpHeaderStat(/*hoNone*/ "all", NULL), #if USE_HTCP - {/*hoHtcpReply*/ "HTCP reply", &ReplyHeadersMask}, + HttpHeaderStat(/*hoHtcpReply*/ "HTCP reply", &ReplyHeadersMask), #endif - {/*hoRequest*/ "request", &RequestHeadersMask}, - {/*hoReply*/ "reply", &ReplyHeadersMask} + HttpHeaderStat(/*hoRequest*/ "request", &RequestHeadersMask), + HttpHeaderStat(/*hoReply*/ "reply", &ReplyHeadersMask) #if USE_OPENSSL /* hoErrorDetail */ #endif diff --git a/src/auth/digest/Config.cc b/src/auth/digest/Config.cc index 2d7de1d4d8..7fa1ccaacf 100644 --- a/src/auth/digest/Config.cc +++ b/src/auth/digest/Config.cc @@ -62,15 +62,15 @@ enum http_digest_attr_type { }; static const HttpHeaderFieldAttrs DigestAttrs[DIGEST_ENUM_END] = { - {"username", (http_hdr_type)DIGEST_USERNAME}, - {"realm", (http_hdr_type)DIGEST_REALM}, - {"qop", (http_hdr_type)DIGEST_QOP}, - {"algorithm", (http_hdr_type)DIGEST_ALGORITHM}, - {"uri", (http_hdr_type)DIGEST_URI}, - {"nonce", (http_hdr_type)DIGEST_NONCE}, - {"nc", (http_hdr_type)DIGEST_NC}, - {"cnonce", (http_hdr_type)DIGEST_CNONCE}, - {"response", (http_hdr_type)DIGEST_RESPONSE}, + HttpHeaderFieldAttrs("username", (http_hdr_type)DIGEST_USERNAME), + HttpHeaderFieldAttrs("realm", (http_hdr_type)DIGEST_REALM), + HttpHeaderFieldAttrs("qop", (http_hdr_type)DIGEST_QOP), + HttpHeaderFieldAttrs("algorithm", (http_hdr_type)DIGEST_ALGORITHM), + HttpHeaderFieldAttrs("uri", (http_hdr_type)DIGEST_URI), + HttpHeaderFieldAttrs("nonce", (http_hdr_type)DIGEST_NONCE), + HttpHeaderFieldAttrs("nc", (http_hdr_type)DIGEST_NC), + HttpHeaderFieldAttrs("cnonce", (http_hdr_type)DIGEST_CNONCE), + HttpHeaderFieldAttrs("response", (http_hdr_type)DIGEST_RESPONSE), }; class HttpHeaderFieldInfo; diff --git a/src/format/Token.cc b/src/format/Token.cc index c016b479bf..9a77685749 100644 --- a/src/format/Token.cc +++ b/src/format/Token.cc @@ -22,177 +22,177 @@ namespace Format /// 1-char tokens. static TokenTableEntry TokenTable1C[] = { - {">a", LFT_CLIENT_IP_ADDRESS}, - {">p", LFT_CLIENT_PORT}, - {">A", LFT_CLIENT_FQDN}, + TokenTableEntry(">a", LFT_CLIENT_IP_ADDRESS), + TokenTableEntry(">p", LFT_CLIENT_PORT), + TokenTableEntry(">A", LFT_CLIENT_FQDN), - {"h", LFT_REQUEST_HEADER}, - {">h", LFT_REQUEST_ALL_HEADERS}, - {"h", LFT_REQUEST_HEADER), + TokenTableEntry(">h", LFT_REQUEST_ALL_HEADERS), + TokenTableEntry("v", LFT_REQUEST_VERSION_OLD_2X}, + TokenTableEntry(">v", LFT_REQUEST_VERSION_OLD_2X), - {"%", LFT_PERCENT}, + TokenTableEntry("%", LFT_PERCENT), - {NULL, LFT_NONE} /* this must be last */ + TokenTableEntry(NULL, LFT_NONE) /* this must be last */ }; /// 2-char tokens static TokenTableEntry TokenTable2C[] = { - {">la", LFT_CLIENT_LOCAL_IP}, - {"la", LFT_LOCAL_LISTENING_IP}, - {">lp", LFT_CLIENT_LOCAL_PORT}, - {"lp", LFT_LOCAL_LISTENING_PORT}, - /*{ "lA", LFT_LOCAL_NAME }, */ - - {"ha", LFT_ADAPTED_REQUEST_HEADER}, - {">ha", LFT_ADAPTED_REQUEST_ALL_HEADERS}, - - {"un", LFT_USER_NAME}, - {"ul", LFT_USER_LOGIN}, - /*{ "ur", LFT_USER_REALM }, */ - /*{ "us", LFT_USER_SCHEME }, */ - {"ui", LFT_USER_IDENT}, - {"ue", LFT_USER_EXTERNAL}, - - {"Hs", LFT_HTTP_SENT_STATUS_CODE_OLD_30}, - {">Hs", LFT_HTTP_SENT_STATUS_CODE}, - {"rm", LFT_CLIENT_REQ_METHOD}, - {">ru", LFT_CLIENT_REQ_URI}, - {">rs", LFT_CLIENT_REQ_URLSCHEME}, - {">rd", LFT_CLIENT_REQ_URLDOMAIN}, - {">rP", LFT_CLIENT_REQ_URLPORT}, - {">rp", LFT_CLIENT_REQ_URLPATH}, - /*{">rq", LFT_CLIENT_REQ_QUERY},*/ - {">rv", LFT_CLIENT_REQ_VERSION}, - - {"rm", LFT_REQUEST_METHOD}, - {"ru", LFT_REQUEST_URI}, /* doesn't include the query-string */ - {"rp", LFT_REQUEST_URLPATH_OLD_31}, - /* { "rq", LFT_REQUEST_QUERY }, * / / * the query-string, INCLUDING the leading ? */ - {"rv", LFT_REQUEST_VERSION}, - {"rG", LFT_REQUEST_URLGROUP_OLD_2X}, - - {"st", LFT_CLIENT_REQUEST_SIZE_TOTAL }, - {">sh", LFT_CLIENT_REQUEST_SIZE_HEADERS }, - /*{ ">sb", LFT_REQUEST_SIZE_BODY }, */ - /*{ ">sB", LFT_REQUEST_SIZE_BODY_NO_TE }, */ - - {"la", LFT_CLIENT_LOCAL_IP), + TokenTableEntry("la", LFT_LOCAL_LISTENING_IP), + TokenTableEntry(">lp", LFT_CLIENT_LOCAL_PORT), + TokenTableEntry("lp", LFT_LOCAL_LISTENING_PORT), + /*TokenTableEntry( "lA", LFT_LOCAL_NAME ), */ + + TokenTableEntry("ha", LFT_ADAPTED_REQUEST_HEADER), + TokenTableEntry(">ha", LFT_ADAPTED_REQUEST_ALL_HEADERS), + + TokenTableEntry("un", LFT_USER_NAME), + TokenTableEntry("ul", LFT_USER_LOGIN), + /*TokenTableEntry( "ur", LFT_USER_REALM ), */ + /*TokenTableEntry( "us", LFT_USER_SCHEME ), */ + TokenTableEntry("ui", LFT_USER_IDENT), + TokenTableEntry("ue", LFT_USER_EXTERNAL), + + TokenTableEntry("Hs", LFT_HTTP_SENT_STATUS_CODE_OLD_30), + TokenTableEntry(">Hs", LFT_HTTP_SENT_STATUS_CODE), + TokenTableEntry("rm", LFT_CLIENT_REQ_METHOD), + TokenTableEntry(">ru", LFT_CLIENT_REQ_URI), + TokenTableEntry(">rs", LFT_CLIENT_REQ_URLSCHEME), + TokenTableEntry(">rd", LFT_CLIENT_REQ_URLDOMAIN), + TokenTableEntry(">rP", LFT_CLIENT_REQ_URLPORT), + TokenTableEntry(">rp", LFT_CLIENT_REQ_URLPATH), + /*TokenTableEntry(">rq", LFT_CLIENT_REQ_QUERY),*/ + TokenTableEntry(">rv", LFT_CLIENT_REQ_VERSION), + + TokenTableEntry("rm", LFT_REQUEST_METHOD), + TokenTableEntry("ru", LFT_REQUEST_URI), /* doesn't include the query-string */ + TokenTableEntry("rp", LFT_REQUEST_URLPATH_OLD_31), + /* TokenTableEntry( "rq", LFT_REQUEST_QUERY ), * / / * the query-string, INCLUDING the leading ? */ + TokenTableEntry("rv", LFT_REQUEST_VERSION), + TokenTableEntry("rG", LFT_REQUEST_URLGROUP_OLD_2X), + + TokenTableEntry("st", LFT_CLIENT_REQUEST_SIZE_TOTAL ), + TokenTableEntry(">sh", LFT_CLIENT_REQUEST_SIZE_HEADERS ), + /*TokenTableEntry( ">sb", LFT_REQUEST_SIZE_BODY ), */ + /*TokenTableEntry( ">sB", LFT_REQUEST_SIZE_BODY_NO_TE ), */ + + TokenTableEntry("2 byte tokens static TokenTableEntry TokenTableMisc[] = { - {">eui", LFT_CLIENT_EUI}, - {">qos", LFT_CLIENT_LOCAL_TOS}, - {"nfmark", LFT_CLIENT_LOCAL_NFMARK}, - {"eui", LFT_CLIENT_EUI), + TokenTableEntry(">qos", LFT_CLIENT_LOCAL_TOS), + TokenTableEntry("nfmark", LFT_CLIENT_LOCAL_NFMARK), + TokenTableEntry("st", LFT_ICAP_BYTES_SENT}, - {"h", LFT_ICAP_REQ_HEADER}, - {"st", LFT_ICAP_BYTES_SENT), + TokenTableEntry("h", LFT_ICAP_REQ_HEADER), + TokenTableEntry("cert_subject", LFT_SSL_USER_CERT_SUBJECT}, - {">cert_issuer", LFT_SSL_USER_CERT_ISSUER}, - {">sni", LFT_SSL_CLIENT_SNI}, - /*{"cert_subject", LFT_SSL_USER_CERT_SUBJECT), + TokenTableEntry(">cert_issuer", LFT_SSL_USER_CERT_ISSUER), + TokenTableEntry(">sni", LFT_SSL_CLIENT_SNI), + /*TokenTableEntry("