╭ changed ─────────────────╮ │src/serve_ssh_protocol.zig│ ╰──────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │217 if (self.idle) |idle| idle.waiting.store(waiting, .release); │ │218 } │ │219 │ │220 - fn writePacket(self: *Conn, payload: []const u8) !void { │ │221 - try self.writePacketVec(&.{payload}); │ │222 - } │ │223 - │ │224 - fn writePacketVec(self: *Conn, parts: []const []const u8) !void { │ │220 + fn writePacket(self: *Conn, parts: []const []const u8) !void { │ │221 self.setWaiting(true); │ │222 defer self.setWaiting(false); │ │227 - try self.sc_cipher.writePacketVec(self.io, self.writer, parts);│ │223 + try self.sc_cipher.writePacket(self.io, self.writer, parts); │ │224 // a peer that keeps reading is alive │ │225 recordActivity(self); │ │226 } │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │405 const chunk_len: u32 = @intCast(cap); │ │406 │ │407 std.mem.writeInt(u32, header[len_start..][0..4], chunk_len, .big); │ │412 - try conn.writePacketVec(&.{ header[0 .. len_start + 4], rest[0..chunk_len] });│ │408 + try conn.writePacket(&.{ header[0 .. len_start + 4], rest[0..chunk_len] }); │ │409 │ │410 self.channel.remote_window -= chunk_len; │ │411 rest = rest[chunk_len..]; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │508 try writeStringField(&req, conn.allocator, "exit-status"); │ │509 try req.append(conn.allocator, 0); // want_reply MUST be false│ │510 try writeU32(&req, conn.allocator, status); │ │515 - try conn.writePacket(req.items); │ │511 + try conn.writePacket(&.{req.items}); │ │512 } │ │513 │ │514 // EOF then CLOSE │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │741 try writeU32(&buf, conn.allocator, reason); │ │742 try writeStringField(&buf, conn.allocator, description); │ │743 try writeStringField(&buf, conn.allocator, ""); // language tag │ │748 - try conn.writePacket(buf.items); │ │744 + try conn.writePacket(&.{buf.items}); │ │745 } │ │746 │ │747 // ---------------------------------------------------------------------------│ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │846 try writePlainPacket(io, writer, payload); │ │847 seqs.written += 1; │ │848 }, │ │853 - .encrypted => |ciphers| try ciphers.sc.writePacket(io, writer, payload), │ │849 + .encrypted => |ciphers| try ciphers.sc.writePacket(io, writer, &.{payload}),│ │850 } │ │851 } │ │852 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │885 try buf.append(conn.allocator, SSH_MSG_UNIMPLEMENTED); │ │886 // the read already advanced past the packet we're rejecting │ │887 try writeU32(&buf, conn.allocator, @truncate(conn.cs_cipher.seq - 1));│ │892 - try conn.writePacket(buf.items); │ │888 + try conn.writePacket(&.{buf.items}); │ │889 } │ │890 │ │891 fn recordActivity(conn: *Conn) void { │ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │1136 │ │1137 const server_kex_init = try buildServerKexInit(conn.io, conn.allocator); │ │1138 defer conn.allocator.free(server_kex_init); │ │1143 - try conn.sc_cipher.writePacket(conn.io, conn.writer, server_kex_init); │ │1139 + try conn.sc_cipher.writePacket(conn.io, conn.writer, &.{server_kex_init});│ │1140 │ │1141 var negotiated = try exchangeKeys( │ │1142 conn.io, │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │1489 return bytes.len >= 4 + (try self.bodyLength(bytes[0..4])) + Poly1305.mac_length;│ │1490 } │ │1491 │ │1492 + /// the payload is the concatenation of `parts` │ │1493 pub fn writePacket( │ │1494 self: *Cipher, │ │1495 io: std.Io, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────╮ │1496 writer: *std.Io.Writer, │ │1500 - payload: []const u8, │ │1501 - ) !void { │ │1502 - try self.writePacketVec(io, writer, &.{payload});│ │1503 - } │ │1504 - │ │1505 - /// the payload is the concatenation of `parts` │ │1506 - pub fn writePacketVec( │ │1507 - self: *Cipher, │ │1508 - io: std.Io, │ │1509 - writer: *std.Io.Writer, │ │1497 parts: []const []const u8, │ │1498 ) !void { │ │1499 var payload_len: usize = 0; │ ╰───────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │1634 defer accept.deinit(allocator); │ │1635 try accept.append(allocator, SSH_MSG_SERVICE_ACCEPT); │ │1636 try writeStringField(&accept, allocator, "ssh-userauth"); │ │1650 - try conn.writePacket(accept.items); │ │1637 + try conn.writePacket(&.{accept.items}); │ │1638 } │ │1639 │ │1640 // step 2: USERAUTH loop until SUCCESS. accept any ed25519 key whose│ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯