[tor-bugs] #9214 [Tor]: Allow alternate bw limits in k/m/g bits

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Jul 6 11:43:37 UTC 2013


#9214: Allow alternate bw limits in k/m/g bits
-------------------------+--------------------------------------------------
 Reporter:  hsn          |          Owner:     
     Type:  enhancement  |         Status:  new
 Priority:  normal       |      Milestone:     
Component:  Tor          |        Version:     
 Keywords:               |         Parent:     
   Points:               |   Actualpoints:     
-------------------------+--------------------------------------------------

Comment(by arma):

 You're in luck!

 {{{
 static struct unit_table_t memory_units[] = {
   { "",          1 },
   { "b",         1<< 0 },
   { "byte",      1<< 0 },
   { "bytes",     1<< 0 },
   { "kb",        1<<10 },
   { "kbyte",     1<<10 },
   { "kbytes",    1<<10 },
   { "kilobyte",  1<<10 },
   { "kilobytes", 1<<10 },
   { "m",         1<<20 },
   { "mb",        1<<20 },
   { "mbyte",     1<<20 },
   { "mbytes",    1<<20 },
   { "megabyte",  1<<20 },
   { "megabytes", 1<<20 },
   { "gb",        1<<30 },
   { "gbyte",     1<<30 },
   { "gbytes",    1<<30 },
   { "gigabyte",  1<<30 },
   { "gigabytes", 1<<30 },
   { "tb",        U64_LITERAL(1)<<40 },
   { "terabyte",  U64_LITERAL(1)<<40 },
   { "terabytes", U64_LITERAL(1)<<40 },
   { NULL, 0 },
 };
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9214#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list