Skip to content

tool: support fractions for --limit-rate and --max-filesize#20266

Closed
bagder wants to merge 4 commits intomasterfrom
bagder/limite-rate-fraction
Closed

tool: support fractions for --limit-rate and --max-filesize#20266
bagder wants to merge 4 commits intomasterfrom
bagder/limite-rate-fraction

Conversation

@bagder
Copy link
Member

@bagder bagder commented Jan 12, 2026

Allow 2.5k or 3.7M etc. Add mention in documentation.

Verify in test case 1623.

@bagder bagder marked this pull request as ready for review January 12, 2026 12:49
@testclutch
Copy link

Analysis of PR #20266 at be1b5876:

Test 3024 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 12 different CI jobs (the link just goes to one of them).

Generated by Testclutch

@bagder bagder force-pushed the bagder/limite-rate-fraction branch from be1b587 to ce68df0 Compare January 12, 2026 13:39
@bagder bagder added the feature-window A merge of this requires an open feature window label Jan 12, 2026
@bagder bagder force-pushed the bagder/limite-rate-fraction branch from 66ce0d9 to cac565d Compare January 12, 2026 14:19
@bagder

This comment was marked as resolved.

@bagder bagder force-pushed the bagder/limite-rate-fraction branch from 3cf1bf3 to 8663c3e Compare January 12, 2026 15:06
@vszakats

This comment was marked as resolved.

vszakats added a commit that referenced this pull request Jan 12, 2026
No longer necessary after making GHA/checksrc also run on `*.md` file
changes.

Reported-by: Daniel Stenberg
Bug: #20266 (comment)
Follow-up to 3800a26 #18935
Follow-up to 9acecc9 #15423
Closes #20268
vszakats added a commit that referenced this pull request Jan 12, 2026
Also:
- drop separate check for 3 or more consecutive empty lines.

Ref: #20266 (comment)

Closes #20269
Allow 2.5k or 3.7M etc. Add mention in documentation.

Verify in test case 1623.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for fractional values in the --limit-rate and --max-filesize command-line options. Users can now specify values like 2.5k or 3.7M instead of being limited to integers.

Changes:

  • Refactored GetSizeParameter function to parse and handle fractional values with unit suffixes
  • Added comprehensive unit test (test1623) covering various fractional input formats and edge cases
  • Updated documentation for both --limit-rate and --max-filesize to explain fractional value support

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/tool_getparam.c Rewrote GetSizeParameter to support fractional values, added unit lookup helper function
src/tool_getparam.h Exposed GetSizeParameter for unit testing
tests/tunit/tool1623.c Added comprehensive unit test for size parameter parsing with fractional values
tests/tunit/Makefile.inc Added new unit test to build system
tests/data/test1623 Added test case definition
tests/data/Makefile.am Registered new test in test suite
docs/cmdline-opts/max-filesize.md Documented fractional value support, added example
docs/cmdline-opts/limit-rate.md Documented fractional value support, updated example

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder bagder closed this in 6d6899c Jan 17, 2026
@bagder bagder deleted the bagder/limite-rate-fraction branch January 17, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmdline tool feature-window A merge of this requires an open feature window tests

Development

Successfully merging this pull request may close these issues.

4 participants