diff options
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.zig b/src/main.zig index ce1c5bba..fafafc08 100644 --- a/src/main.zig +++ b/src/main.zig @@ -884,7 +884,7 @@ fn remoteAttach(init: std.process.Init, opts: pardes.Options, where: []const u8, } }; if (std.mem.indexOfScalar(u8, where, '/') != null) { - @import("tty/tty.zig").remote(init, opts, where, name) catch |err| Say.no(io, "{t}", .{err}); + @import("tty/tty.zig").remote(init, opts, where, name, false) catch |err| Say.no(io, "{t}", .{err}); std.process.exit(0); } // ssh -L <here>:<there> <host>, until the socket here answers. @@ -902,10 +902,12 @@ fn remoteAttach(init: std.process.Init, opts: pardes.Options, where: []const u8, var argv: [48:null]?[*:0]const u8 = @splat(null); var n: usize = 0; var words_buf: [1024]u8 = undefined; - // Compressed by default: the join's dump is text, and the FreeBSD box's - // link carries 170 to 400 KB/s (a 3.9 MB join: 7.8 s plain, 5.4 with - // -C). $PARDES_SSH, when set, is the whole command. - var words = std.mem.tokenizeScalar(u8, std.mem.span(std.c.getenv("PARDES_SSH") orelse "ssh -C"), ' '); + // Not `ssh -C`: what the session sends a far client is zstd already + // (replica.zig), and zlib over it costs both ends' time for nothing. + // ponytail: what the client sends goes as it is, keys and a paste + // alike; a big paste through a slow link is the ceiling, and would be + // an envelope of its own. $PARDES_SSH, when set, is the whole command. + var words = std.mem.tokenizeScalar(u8, std.mem.span(std.c.getenv("PARDES_SSH") orelse "ssh"), ' '); var at: usize = 0; while (words.next()) |w| { if (n >= 40 or at + w.len + 1 > words_buf.len) Say.no(io, "PARDES_SSH has too many words", .{}); @@ -953,7 +955,7 @@ fn remoteAttach(init: std.process.Init, opts: pardes.Options, where: []const u8, const ts: std.c.timespec = .{ .sec = 0, .nsec = 10 * std.time.ns_per_ms }; _ = std.c.nanosleep(&ts, null); } - @import("tty/tty.zig").remote(init, opts, here, name) catch |err| { + @import("tty/tty.zig").remote(init, opts, here, name, true) catch |err| { Ssh.end(); Say.no(io, "{t}", .{err}); }; |
