M cmd/btinfo/main.ha => cmd/btinfo/main.ha +2 -1
@@ 59,7 59,8 @@ fn dump(conf: *config, in: io::handle) void = {
};
defer torrent::torrent_free(tor);
- fmt::printfln("name: {}", tor.info.name)!;
+ fmt::printfln("name: {}{}", tor.info.name,
+ if (tor.info.private) " (private)" else "")!;
fmt::printfln("announce: {}", tor.announce)!;
match (tor.info.length) {
M torrent/torrent.ha => torrent/torrent.ha +3 -0
@@ 13,6 13,7 @@ export type info = struct {
name: str,
piecelen: size,
pieces: []u8,
+ private: bool,
length: (size | void),
files: []file,
};
@@ 66,6 67,8 @@ export fn read(in: io::handle) (*torrent | error) = {
return invalid;
};
t.info.pieces = alloc(pieces...);
+ case "private" =>
+ t.info.private = getint(rec.1)? == 1;
case "length" =>
t.info.length = getint(rec.1)?: size;
case "files" =>