… | |
… | |
253 | my ($ob, $arg) = @_; |
253 | my ($ob, $arg) = @_; |
254 | |
254 | |
255 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
255 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
256 | unless $arg > 0; |
256 | unless $arg > 0; |
257 | |
257 | |
|
|
258 | # minimum is 2k/s |
258 | $ob->contr->ns->max_rate ($arg * $cf::TICK); |
259 | $ob->contr->ns->max_rate ((List::Util::max 2048, $arg) * $cf::TICK); |
259 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); |
260 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); |
260 | |
261 | |
261 | 1 |
262 | 1 |
262 | }; |
263 | }; |
263 | |
264 | |