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

multi: Rework client user agent id logic. #415

Merged

Commits on Oct 18, 2023

  1. semver: Refactor semver parsing to internal pkg.

    This moves the semver parsing code into an internal package and adds
    tests to ensure proper functionality.
    
    The primary motiviation is to make it available for reuse in other
    packages such as the pool package.
    davecgh committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    a80f837 View commit details
    Browse the repository at this point in the history
  2. pool: Rework client user agent id logic.

    This reworks the client user agent identification logic to improve its
    efficiency and flexibility as well as to easily support old minor
    versions.
    
    It does this by changing the matching logic to first parse the user
    agent into its individual components and then attempting to match
    against that parsed information using matching functions as opposed to
    encoding the more specific matching logic directly into a regular
    expression.
    
    The user agent parsing first attempts to split it into a client name and
    version part and when that is successful further attempts to parse the
    version part into the individual semantic version components using a
    regular expression with capture groups.
    
    The matching functions are closures that accept the parsed user agent
    details and may impose arbitrary criteria.
    
    For convenience a default matching function is added that requires the
    user agent to have a provided client name and major version as well as a
    minor version that is less than or equal to specified value.
    
    The user agent matching tests are updated accordingly.
    
    Finally, `decred-gominer` is updated to support up to version 2.1.x so
    the pool will work with both version 2.0.0 as well as the master branch
    that will be moving to version 2.1.0-pre for ongoing development.
    davecgh committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    e3e3d22 View commit details
    Browse the repository at this point in the history