#20622 closed defect (implemented)

Unit abbreviations "TByte" and "TBytes" are unsupported

Reported by: mnordhoff Owned by:
Priority: Medium Milestone: Tor: 0.3.0.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Normal Keywords: CoreTorTeam201611
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Tor's configuration, for settings like BandwidthRate, supports unit abbreviates like "KB", "MByte", and "GBytes".

For tera-, it supports "TB", and apparently "terabyte(s)", "terabit(s)" and "TBit(s)", but not "TByte" or "TBytes".

The man page suggests that they should be supported, without quite entirely saying so:

bytes|KBytes|MBytes|GBytes|KBits|MBits|GBits
The prefixes "tera" and "T" are also recognized.

Bug on c10faf50858943edafe042664b49f8a743df6d7c (r12936) in 0.2.0.14-alpha, i would say, when "KByte(s)", "MByte(s)" and "GByte(s)" were introduced. ("TB" and "terabyte(s)" already existed.)

I have a (two-line) patch, but i have NOT checked that it works or even compiles.

-- Peng

Child Tickets

Attachments (4)

0001-Add-TByte-and-TBytes-abbreviations-as-units-of-measu.patch (810 bytes) - added by mnordhoff 13 months ago.
0002-Add-TBits-and-TBytes-to-man-page.patch (7.9 KB) - added by mnordhoff 13 months ago.
0003-Changes-file-for-bug-20622-TBytes.patch (865 bytes) - added by mnordhoff 13 months ago.
changes file v2 (include the TBits man page part)
0001-Add-TByte-and-TBytes-units-also-add-TBits-to-man-pag.patch (9.1 KB) - added by mnordhoff 13 months ago.
Squashed patch, if you prefer it

Download all attachments as: .zip

Change History (9)

Changed 13 months ago by mnordhoff

comment:1 Changed 13 months ago by mnordhoff

Status: newneeds_review

I built it (with the patches backported to 0.2.9.4-alpha-1, actually) and it looks good.

(Copying and pasting two lines of code is hard to get wrong.)

comment:2 Changed 13 months ago by teor

Keywords: CoreTorTeam201611 added
Milestone: Tor: 0.3.0.x-final
Status: needs_reviewmerge_ready
Version: Tor: unspecified

Looks good to me.

comment:3 Changed 13 months ago by arma

does it want a changes file? (does it have one and i missed it?)

comment:4 Changed 13 months ago by mnordhoff

There wasn't one. Here's a patch adding a "Minor bugfixes (configuration)" entry.

Changed 13 months ago by mnordhoff

changes file v2 (include the TBits man page part)

Changed 13 months ago by mnordhoff

Squashed patch, if you prefer it

comment:5 Changed 13 months ago by nickm

Resolution: implemented
Status: merge_readyclosed

LGTM too; merged!

Note: See TracTickets for help on using tickets.