5a1de1acd2
When no piece length is provided to imdl torrent create, a piece length is selected based on the size of the input. The hueristic is lifted directly from libtorrent. Also adds a imdl torrent piece-length command, which prints a table of the piece lengths chosen at different content sizes, which is useful for understanding and debugging the piece length selection algorithm. type: added
12 lines
321 B
Rust
12 lines
321 B
Rust
macro_rules! outln {
|
|
($env:expr) => {
|
|
writeln!($env.out, "").context(crate::error::Stderr)?;
|
|
};
|
|
($env:expr, $fmt:expr) => {
|
|
writeln!($env.out, $fmt).context(crate::error::Stderr)?;
|
|
};
|
|
($env:expr, $fmt:expr, $($arg:tt)*) => {
|
|
writeln!($env.out, $fmt, $($arg)*).context(crate::error::Stderr)?;
|
|
};
|
|
}
|