]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed HttpHeaderFieldInfo and related methods
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 3 Aug 2015 10:40:17 +0000 (12:40 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 3 Aug 2015 10:40:17 +0000 (12:40 +0200)
src/HttpHeader.cc
src/HttpHeader.h
src/HttpHeaderTools.cc
src/HttpHeaderTools.h

index bdf556cb0145aabc706019102f1c4af2c0c6002f..9763f4c5c3bfaa88b43a978c7382e2bc620625ff 100644 (file)
@@ -1726,23 +1726,6 @@ httpHeaderStoreReport(StoreEntry * e)
     storeAppendPrintf(e, "Hdr Fields Parsed: %d\n", HeaderEntryParsedCount);
 }
 
-// (ab)used by other modules.
-http_hdr_type
-httpHeaderIdByName(const char *name, size_t name_len, const HttpHeaderFieldInfo * info, int end)
-{
-    if (name_len > 0) {
-        for (int i = 0; i < end; ++i) {
-            if (name_len != info[i].name.size())
-                continue;
-
-            if (!strncasecmp(name, info[i].name.rawBuf(), name_len))
-                return info[i].id;
-        }
-    }
-
-    return HDR_BAD_HDR;
-}
-
 http_hdr_type
 httpHeaderIdByNameDef(const SBuf &name)
 {
index 5ac12e3e7fd27fdbf6f2a1bc5e94ae74175a516a..a79467c06bd65e362f377479594753b6e5fbd93d 100644 (file)
@@ -40,23 +40,6 @@ typedef enum {
     hoEnd
 } http_hdr_owner_type;
 
-class HttpHeaderFieldAttrs
-{
-public:
-    HttpHeaderFieldAttrs() : name(NULL), id(HDR_BAD_HDR), type(field_type::ftInvalid) {}
-    HttpHeaderFieldAttrs(const char *aName, http_hdr_type anId, field_type aType = field_type::ftInvalid) : name(aName), id(anId), type(aType) {}
-#if __cplusplus >= 201103L
-    HttpHeaderFieldAttrs(const HttpHeaderFieldAttrs &) = default;
-    HttpHeaderFieldAttrs(HttpHeaderFieldAttrs &&) = default;
-#endif
-    // nothing to do as name is a pointer to global const string
-    ~HttpHeaderFieldAttrs() {}
-
-    const char *name;
-    http_hdr_type id;
-    field_type type;
-};
-
 /** Iteration for headers; use HttpHeaderPos as opaque type, do not interpret */
 typedef ssize_t HttpHeaderPos;
 
index 1083bdfb491278e32e1a6f971af000768432c977..f5a97998f9a70c05627f84597b4d2a1e5d8eebdd 100644 (file)
 
 static void httpHeaderPutStrvf(HttpHeader * hdr, http_hdr_type id, const char *fmt, va_list vargs);
 
-HttpHeaderFieldInfo *
-httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count)
-{
-    int i;
-    HttpHeaderFieldInfo *table = NULL;
-    assert(attrs && count);
-
-    /* allocate space */
-    table = new HttpHeaderFieldInfo[count];
-
-    for (i = 0; i < count; ++i) {
-        const http_hdr_type id = attrs[i].id;
-        HttpHeaderFieldInfo *info = table + id;
-        /* sanity checks */
-        assert(id >= 0 && id < count);
-        assert(attrs[i].name);
-        assert(info->id == HDR_ACCEPT && info->type == field_type::ftInvalid);  /* was not set before */
-        /* copy and init fields */
-        info->id = id;
-        info->type = attrs[i].type;
-        info->name = attrs[i].name;
-        assert(info->name.size());
-    }
-
-    return table;
-}
-
-void
-httpHeaderDestroyFieldsInfo(HttpHeaderFieldInfo * table, int count)
-{
-    int i;
-
-    for (i = 0; i < count; ++i)
-        table[i].name.clean();
-
-    delete [] table;
-}
-
 void
 httpHeaderMaskInit(HttpHeaderMask * mask, int value)
 {
index a12d9ca1bd210ad8002a960c75cf5c93f6bb9ee2..94a253d2109335579ad998fcb041ce05800c884c 100644 (file)
@@ -115,9 +115,6 @@ public:
 
 int httpHeaderParseOffset(const char *start, int64_t * off);
 
-HttpHeaderFieldInfo *httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count);
-void httpHeaderDestroyFieldsInfo(HttpHeaderFieldInfo * info, int count);
-http_hdr_type httpHeaderIdByName(const char *name, size_t name_len, const HttpHeaderFieldInfo * attrs, int end);
 http_hdr_type httpHeaderIdByNameDef(const SBuf &name);
 http_hdr_type httpHeaderIdByNameDef(const char *name, int name_len);
 int httpHeaderHasConnDir(const HttpHeader * hdr, const char *directive);