]> git.ipfire.org Git - thirdparty/squid.git/commit
Reduce testHttpRange dependencies (#2148)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 30 Aug 2025 22:09:14 +0000 (22:09 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 31 Aug 2025 03:34:29 +0000 (03:34 +0000)
commitc99cbe69bfa8e6944810a47f9bfb08188a7dcb0f
tree772b6849f2d1287eafc7e3e04f0503f1ada472b3
parent039bd8957c15fa4e29bcb60bffc85d3c41f860de
Reduce testHttpRange dependencies (#2148)

This drastic reduction in testHttpRange dependencies is made possible by
splitting HeaderTools code into several parts:

* Header-mangling code that pulled in many heavy dependencies but was
  unused by testHttpRange code. This high-level code does not belong to
  libhttp, so it was left in src/ (see HeaderMangling.cc).

* Simple header manipulation functions without heavy dependencies; some
  used by testHttpRange code. This low-level code should eventually be
  moved to libhttp, but it was left in HttpHeaderTools.cc for now
  because libhttp itself is currently bloated with heavy dependencies --
  linking with libhttp requires linking with or stubbing a lot of
  code unrelated to testHttpRange.

* Definition of httpHeaderParseQuotedString() and a few other functions
  declared in HttpHeader.h were moved to HttpHeader.cc to improve
  declaration/definition/stubs affinity and avoid linking errors:
  testHttpRange now depends on stub_HttpHeader.cc that has stubs for
  these functions.

* httpHeaderMaskInit() and getStringPrefix() are only used by
  HttpHeader.cc, so they were moved to HttpHeader.cc and made static.

Moved code was unchanged. A few comments were relocated to better match
Squid coding style. A few STUBs were added/adjusted as needed.

TODO: Check the remaining two tests that still include header mangling
code: testHttpRequest and testCacheManager.
18 files changed:
src/HeaderMangling.cc [new file with mode: 0644]
src/HeaderMangling.h [new file with mode: 0644]
src/HttpHeader.cc
src/HttpHeaderMask.h
src/HttpHeaderTools.cc
src/HttpHeaderTools.h
src/Makefile.am
src/SquidConfig.h
src/acl/HttpHeaderData.cc
src/auth/negotiate/UserRequest.cc
src/cache_cf.cc
src/client_side.cc
src/client_side_reply.cc
src/external_acl.cc
src/http.cc
src/servers/Http1Server.cc
src/tests/stub_libhttp.cc
src/tests/testHttpRange.cc