Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: implement Ip::Address::asText() #1739

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from

Commits on Mar 15, 2024

  1. Configuration menu
    Copy the full SHA
    c673207 View commit details
    Browse the repository at this point in the history
  2. Add unit tests for toStrAsSBuf

    kinkie committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    b97f3ed View commit details
    Browse the repository at this point in the history
  3. convert all uses in Header.cc

    kinkie committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    49b1423 View commit details
    Browse the repository at this point in the history
  4. convert peer_sourcehash.cc

    kinkie committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    8979a90 View commit details
    Browse the repository at this point in the history
  5. Source maintenance

    kinkie committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    7e6b316 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2024

  1. Configuration menu
    Copy the full SHA
    1ab9f10 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Fix heap buffer overead in ConfigParser::UnQuote() (squid-cache#1763)

    Detected by using AddressSanitizer.
    xiaoxiaoafeifei authored and kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    5f2ee67 View commit details
    Browse the repository at this point in the history
  2. Do not blame cache_peer for CONNECT errors (squid-cache#1772)

        ERROR: Connection to [such-and-such-cache_peer] failed
        TCP_TUNNEL/503 CONNECT nxdomain.test:443 FIRSTUP_PARENT
    
    Squid does not alert an admin about (and decrease health level of) a
    cache_peer that responded with an error to a GET request. Just like GET
    responses from a cache_peer, CONNECT responses may (and often do!)
    reflect client or origin server failures. We should not penalize
    cache_peers (and alert admins) until we can distinguish these frequent
    client/origin failures from (relatively rare) cache_peer problems. This
    change absolves cache_peers of CONNECT problems, restoring parity with
    GETs and restoring v4 behavior changed (probably by accident) in v5.
    
    Also removed Http::StatusCode parameter from failure notification
    functions because it became essentially unused after the primary
    Http::Tunneler changes. Tunneler was the only source of status code
    information that (in some cases) used received HTTP response to compute
    that status code. All other cases extracted that status code from
    Squid-generated errors. Those errors were arguably never meant to supply
    status code information for "this failure is not our fault" decision,
    and they do not supply 4xx status codes driving that decision.
    
    ### Problem evolution
    
    2019 commit f5e1794 effectively started blaming cache_peer for all
    FwdState CONNECT errors. That functionality change was probably
    accidental, likely influenced by the names of noteConnectFailure() and
    peerConnectFailed() functions that abbreviated "Connection", making the
    functions look as applicable to CONNECT failures. Prior to that commit,
    the functions were never used for CONNECT errors. After it, FwdState
    started calling peerConnectFailed() for all CONNECT failures.
    
    In 2020 commit 25b0ce4, TunnelStateData started blaming cache_peers as
    well (by moving that FwdState-only error handling code into Tunneler).
    The same "accidental functionality change" speculations apply here.
    
    In 2022 commit 022dbab, we made an exception for 4xx CONNECT errors as
    folks deploying newer code started complaining about cache_peers getting
    blamed for client-caused errors (e.g., HTTP 403 Forbidden replies). We
    did not realize that the blaming code itself was an unwanted accident.
    
    Now we are getting complaints about cache_peers getting blamed for 502
    and 503 CONNECT errors caused by, for example, domain names without IPs:
    As these CONNECT error responses are propagated from parent to child
    caches, every child cache in the chain logs ERRORs and every cache_peer
    in the chain gets its health counter decreased!
    rousskov authored and kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    0a15787 View commit details
    Browse the repository at this point in the history
  3. Fix const-correctness of ACLHTTPHeaderData::match() parameter (squid-…

    …cache#1771)
    
    ACLHTTPHeaderData::match() required a pointer to non-const HttpHeader
    but does not (and should not) modify the supplied HttpHeader.
    
    Also removed support for nil HttpHeader in that method. All callers
    already require HttpHeader presence. If that changes, it is the _caller_
    that should decide what HttpHeader absence means (match, mismatch,
    exception/dunno, etc.); ACLHTTPHeaderData does not have enough
    information to make the right choice and, hence, should not be asked to
    choose.
    
    Also polished related #includes to remove unnecessary ones.
    rousskov authored and kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    95bd8d1 View commit details
    Browse the repository at this point in the history
  4. Fix eCAP header includes (squid-cache#1753)

    Squid style guidelines require .h files to be wrapped with
    HAVE_*_H protection and placed after all Squid internal file
    includes.
    
    Add the missing ./configure header checks to generate the
    needed wrappers and refactor the include sequences to meet
    current guidelines.
    yadij authored and kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    ba29475 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1b46e26 View commit details
    Browse the repository at this point in the history
  6. Have SQUID_CHECK_LIB_WORKS do state SAVE/RESTORE (squid-cache#1774)

    Removing a lot of duplicated code and further
    simplifying library detection.
    yadij authored and kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    6105648 View commit details
    Browse the repository at this point in the history
  7. NoNewGlobals for MemBlob::Stats (squid-cache#1749)

    Detected by Coverity. CID 1554656: Initialization or destruction
    ordering is unspecified (GLOBAL_INIT_ORDER).
    
    Also update MemBlobStats initialization.
    kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    468faa7 View commit details
    Browse the repository at this point in the history
  8. Refactor and improve ErrorState::Dump (squid-cache#1730)

    Rework the internals for generating output in ErrorState::Dump,
    used for expanding the '%W' token in error page templates.
    
    Also fix a bug with excessive html-quoting of the output.
    kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    bf14fcc View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a422967 View commit details
    Browse the repository at this point in the history
  10. NoNewGlobals for HttpHdrCc:ccLookupTable (squid-cache#1750)

    Detected by Coverity. CID 1554655: Initialization or destruction
    ordering is unspecified (GLOBAL_INIT_ORDER).
    
    Also switched to compile-time checks for table initialization records.
    kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    06644aa View commit details
    Browse the repository at this point in the history
  11. Feature-complete, tests to do

    kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    343f04b View commit details
    Browse the repository at this point in the history
  12. Upgrade Acl::Node::name to SBuf; remove AclMatchedName global (squid-…

    …cache#1766)
    
    AclMatchedName global has been localized into a regular Acl::Answer data
    member (Acl::Answer maintains the result of ACLChecklist evaluations).
    This long overdue change resolves an old TODO and XXXs, paving the way
    for Acl::Node reference counting.
    
    No significant functionality changes are expected, but it is possible
    that some deny_info configurations will now be handled better in
    reconfiguration corner cases (because Squid no longer forgets the name
    of the last checked ACL when a slow ACL check crosses reconfiguration
    barrier).
    
    Most of these changes are performance-neutral or -positive because they
    eliminate or reduce memory allocations and associated name copying (and
    more reduction will become possible after upgrading squid.conf parsers
    to use SBuf). This change adds SBuf object copies when Acl::Answer is
    propagated to ACLCB callbacks, but those read-only copies are cheap.
    
    Also renamed and polished aclGetDenyInfoPage() because we had to update
    its parameter type (to supply the last evaluated ACL). All callers were
    also supplying the same first argument (that is unlikely to change in
    the foreseeable future); that argument is now gone. We  did not fix the
    redirect_allowed name and debugs(): Fixing that behavior deserves a
    dedicated change.
    
    Also polished legacy aclIsProxyAuth() profile and description because we
    have to change the parameter type (to supply the last evaluated ACL).
    
    Also removed 63-character aclname parameter limit for acl directives.
    rousskov authored and kinkie committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    6007f79 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    beee7cb View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    96489ce View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    899724a View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2024

  1. Configuration menu
    Copy the full SHA
    794cad1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c8f7293 View commit details
    Browse the repository at this point in the history
  3. source maintenance

    kinkie committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    c73c17f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a38723a View commit details
    Browse the repository at this point in the history
  5. Add Ip::Address::asText()

    kinkie committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    4de23d0 View commit details
    Browse the repository at this point in the history
  6. remove toStrAsSBuf

    kinkie committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    abf7d4d View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. fix wrong API name

    kinkie committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    9a19f31 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15ca319 View commit details
    Browse the repository at this point in the history
  3. Fix peer_sourcehash.cc

    kinkie committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    e29fa69 View commit details
    Browse the repository at this point in the history
  4. Revert formatting change

    kinkie committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    ec14be4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    88402b1 View commit details
    Browse the repository at this point in the history
  6. Document AddressText methods

    kinkie committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    80dd4bf View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8545ac0 View commit details
    Browse the repository at this point in the history