-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
740fe73
commit f1be8b1
Showing
2 changed files
with
105 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters