aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-05 04:00:14 +0100
committertv <tv@krebsco.de>2026-11-05 04:00:14 +0100
commitf0ef5c33998964d21c5cf5c582cd194327429003 (patch)
tree726357c373a0145716f1ee0ec00bfd769b5a934b /src/transport
parentf7ce22ed0ba4a758bdc7de0f21b6d0cb45a866b1 (diff)
deflate blob chunks
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/mod.rs12
-rw-r--r--src/transport/wire.rs2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs
index 1e9e5a9..eeb9d34 100644
--- a/src/transport/mod.rs
+++ b/src/transport/mod.rs
@@ -322,6 +322,13 @@ pub(crate) enum BlobBody {
},
/// The sender doesn't have the blob.
Missing,
+ /// A chunk, deflated (`compress`): the receiver inflates it to the chunk, which the
+ /// manifest's hash is of, whoever sent it.
+ DeflatedChunk {
+ index: u32,
+ #[serde(with = "crate::transport::wire::codec::shared_bytes")]
+ data: bytes::Bytes,
+ },
}
/// Sizes instead of contents: logged messages stay short.
@@ -349,6 +356,11 @@ impl std::fmt::Debug for BlobBody {
.field("bytes", &data.len())
.finish(),
BlobBody::Missing => f.write_str("Missing"),
+ BlobBody::DeflatedChunk { index, data } => f
+ .debug_struct("DeflatedChunk")
+ .field("index", index)
+ .field("bytes", &data.len())
+ .finish(),
}
}
}
diff --git a/src/transport/wire.rs b/src/transport/wire.rs
index a722065..2794e69 100644
--- a/src/transport/wire.rs
+++ b/src/transport/wire.rs
@@ -14,7 +14,7 @@ use super::{EncodedMessage, MessageKind, ParsedMessage};
/// The wire format's version, the first byte of every payload. Bump it with every change
/// to a message type or a codec (`golden_bytes` fails then).
-pub(crate) const VERSION: u8 = 31;
+pub(crate) const VERSION: u8 = 32;
/// What the second byte of a payload says.
fn tag(kind: MessageKind) -> u8 {