]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/format/Token.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / format / Token.h
index 16e21787b5bcdeec852cd818ee3fbbc9352237b2..b525e9cda20d7b5662103c7ca15f8f5272b9d146 100644 (file)
@@ -1,8 +1,16 @@
+/*
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef _SQUID_FORMAT_TOKEN_H
 #define _SQUID_FORMAT_TOKEN_H
 
-//#include "format/TokenTableEntry.h"
 #include "format/ByteCode.h"
+#include "proxyp/Elements.h"
 
 /*
  * Squid configuration allows users to define custom formats in
@@ -43,6 +51,9 @@ public:
     const char *label;
     struct {
         char *string;
+        // TODO: Add ID caching for protocols other than PROXY protocol.
+        /// the cached ID of the parsed header or zero
+        ProxyProtocol::Two::FieldType headerId;
 
         struct {
             char *header;
@@ -57,7 +68,7 @@ public:
     bool space;
     bool zero;
     int divisor;    // class invariant: MUST NOT be zero.
-    Token *next;       /* todo: move from linked list to array */
+    Token *next;    // TODO: move from linked list to array
 
 private:
     const char *scanForToken(TokenTableEntry const table[], const char *cur);
@@ -66,3 +77,4 @@ private:
 } // namespace Format
 
 #endif /* _SQUID_FORMAT_TOKEN_H */
+