atproto relay implementation in zig zlay.waow.tech

fix: use File.readAll directly for /proc metrics, thread headers through admin GET handlers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+6 -4
+6 -4
src/broadcaster.zig
··· 626 626 if (std.fs.openFileAbsolute("/proc/self/statm", .{})) |f| { 627 627 defer f.close(); 628 628 var statm_buf: [256]u8 = undefined; 629 - if (f.reader().readAll(&statm_buf)) |n| { 629 + const n = f.readAll(&statm_buf) catch 0; 630 + if (n > 0) { 630 631 const line = statm_buf[0..n]; 631 632 var iter = std.mem.splitScalar(u8, line, ' '); 632 633 _ = iter.next(); // skip total pages ··· 639 640 , .{pages * 4096}) catch {}; 640 641 } else |_| {} 641 642 } 642 - } else |_| {} 643 + } 643 644 } else |_| {} 644 645 645 646 // thread count from /proc/self/status 646 647 if (std.fs.openFileAbsolute("/proc/self/status", .{})) |f| { 647 648 defer f.close(); 648 649 var status_buf: [4096]u8 = undefined; 649 - if (f.reader().readAll(&status_buf)) |n| { 650 + const n = f.readAll(&status_buf) catch 0; 651 + if (n > 0) { 650 652 const content = status_buf[0..n]; 651 653 if (std.mem.indexOf(u8, content, "Threads:")) |pos| { 652 654 const rest = content[pos + "Threads:".len ..]; ··· 660 662 , .{threads}) catch {}; 661 663 } else |_| {} 662 664 } 663 - } else |_| {} 665 + } 664 666 } else |_| {} 665 667 } 666 668