diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-07-26 16:07:11 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-07-26 16:07:11 +0200 |
commit | d5a5a6a2534e114b6c89c7ddb7840ab3040657b8 (patch) | |
tree | d8c39fe544686352ff7ee70e0703ba3b48473b3f /src/or/confparse.c | |
parent | 221a0159b81707f7cfcb3ec34c21830e9ce8aca5 (diff) | |
download | tor-d5a5a6a2534e114b6c89c7ddb7840ab3040657b8.tar.gz tor-d5a5a6a2534e114b6c89c7ddb7840ab3040657b8.zip |
Allow {,k,kilo,m,mega,g,giga,t,tera}bit{,s} in torrc
Patch from CharlieB for ticket #9214
Diffstat (limited to 'src/or/confparse.c')
-rw-r--r-- | src/or/confparse.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/confparse.c b/src/or/confparse.c index eb0362f494..41055791ef 100644 --- a/src/or/confparse.c +++ b/src/or/confparse.c @@ -1126,20 +1126,36 @@ static struct unit_table_t memory_units[] = { { "kbytes", 1<<10 }, { "kilobyte", 1<<10 }, { "kilobytes", 1<<10 }, + { "kilobits", 1<<7 }, + { "kilobit", 1<<7 }, + { "kbits", 1<<7 }, + { "kbit", 1<<7 }, { "m", 1<<20 }, { "mb", 1<<20 }, { "mbyte", 1<<20 }, { "mbytes", 1<<20 }, { "megabyte", 1<<20 }, { "megabytes", 1<<20 }, + { "megabits", 1<<17 }, + { "megabit", 1<<17 }, + { "mbits", 1<<17 }, + { "mbit", 1<<17 }, { "gb", 1<<30 }, { "gbyte", 1<<30 }, { "gbytes", 1<<30 }, { "gigabyte", 1<<30 }, { "gigabytes", 1<<30 }, + { "gigabits", 1<<27 }, + { "gigabit", 1<<27 }, + { "gbits", 1<<27 }, + { "gbit", 1<<27 }, { "tb", U64_LITERAL(1)<<40 }, { "terabyte", U64_LITERAL(1)<<40 }, { "terabytes", U64_LITERAL(1)<<40 }, + { "terabits", U64_LITERAL(1)<<37 }, + { "terabit", U64_LITERAL(1)<<37 }, + { "tbits", U64_LITERAL(1)<<37 }, + { "tbit", U64_LITERAL(1)<<37 }, { NULL, 0 }, }; |