diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-13 18:53:37 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-13 18:53:53 +0300 |
| commit | c542fc871743f96f4e665e80f9274a262421d847 (patch) | |
| tree | c3e131449c2fb1d2efc1eb823cfd0123a6e32cd1 /src/server/protocol.rs | |
| parent | b02a9a81d2316822822c81cbb806012ee278fb68 (diff) | |
fix: gate kitty graphics behind config
Diffstat (limited to 'src/server/protocol.rs')
| -rw-r--r-- | src/server/protocol.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/server/protocol.rs b/src/server/protocol.rs index 743817ac..8748c41c 100644 --- a/src/server/protocol.rs +++ b/src/server/protocol.rs @@ -15,10 +15,9 @@ use serde::{Deserialize, Serialize}; /// Current protocol version. Bumped when wire format changes incompatibly. pub const PROTOCOL_VERSION: u32 = 5; -/// Maximum allowed frame payload size (32 MB). Frames larger than this are -/// rejected to prevent denial-of-service via oversized length prefixes while -/// leaving room for first-frame Kitty graphics image uploads. -pub const MAX_FRAME_SIZE: usize = 32 * 1024 * 1024; +/// Maximum allowed frame payload size (2 MB). Frames larger than this are +/// rejected to prevent denial-of-service via oversized length prefixes. +pub const MAX_FRAME_SIZE: usize = 2 * 1024 * 1024; /// Length of the u32 little-endian length prefix in bytes. const LENGTH_PREFIX_BYTES: usize = 4; @@ -47,9 +46,9 @@ pub enum ClientMessage { cols: u16, /// Terminal height in rows. rows: u16, - /// Width of a terminal cell in physical pixels. + /// Width of a terminal cell in physical pixels, or 0 when client-side Kitty graphics are disabled. cell_width_px: u32, - /// Height of a terminal cell in physical pixels. + /// Height of a terminal cell in physical pixels, or 0 when client-side Kitty graphics are disabled. cell_height_px: u32, /// Render encoding requested by the client. requested_encoding: RenderEncoding, @@ -67,9 +66,9 @@ pub enum ClientMessage { cols: u16, /// New terminal height in rows. rows: u16, - /// Width of a terminal cell in physical pixels. + /// Width of a terminal cell in physical pixels, or 0 when client-side Kitty graphics are disabled. cell_width_px: u32, - /// Height of a terminal cell in physical pixels. + /// Height of a terminal cell in physical pixels, or 0 when client-side Kitty graphics are disabled. cell_height_px: u32, }, |
