/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#include "squid.h"
#include "base/LookupTable.h"
-#include "HttpHdrSc.h"
+//#include "HttpHdrSc.h" // pulled in by HttpHdrScTarget.h
+#include "HttpHdrScTarget.h"
#include "HttpHeader.h"
#include "HttpHeaderFieldStat.h"
#include "HttpHeaderStat.h"
/* this table is used for parsing surrogate control header */
/* order must match that of enum http_hdr_sc_type. The constraint is verified at initialization time */
-//todo: implement constraint
+// TODO: implement constraint
static const LookupTable<http_hdr_sc_type>::Record ScAttrs[] {
{"no-store", SC_NO_STORE},
{"no-store-remote", SC_NO_STORE_REMOTE},
assert(i == ScAttrs[i].id);
}
-void
-httpHdrScCleanModule(void)
-{
-}
-
/* implementation */
/* creates an sc object from a 0-terminating string */
++p;
}
- /* decrease ilen to still match the token for ';' qualified non '=' statments */
+ /* decrease ilen to still match the token for ';' qualified non '=' statements */
else if ((p = strchr(item, ';')) && (p - item < ilen)) {
ilen = p - item;
++p;
}
/* Is this a targeted directive? */
- /* TODO: remove the temporary useage and use memrchr and the information we have instead */
+ /* TODO: remove the temporary usage and use memrchr and the information we have instead */
temp = xstrndup (item, initiallen + 1);
if (!((target = strrchr (temp, ';')) && !strchr (target, '"') && *(target + 1) != '\0'))
return NULL;
}
+void
+HttpHdrSc::addTarget(HttpHdrScTarget *t) {
+ dlinkAdd(t, &t->node, &targets);
+}
+
+void
+HttpHdrSc::addTargetAtTail(HttpHdrScTarget *t) {
+ dlinkAddTail (t, &t->node, &targets);
+}
+