diff options
| author | tv <tv@krebsco.de> | 2026-11-29 15:06:04 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 15:06:04 +0000 |
| commit | 8cdde74fcdcf31414da0d22222d2cc338df20fa1 (patch) | |
| tree | 37911374599ed825fa3264c8e99ae830cec843fc /src/swarm/sync.rs | |
| parent | a3af68fafee80b3eef493e8b041e21352e547da2 (diff) | |
wire: what another kind of document says, in a SYNC's body and a STATUS's stamp
From version 53 on, beside Automerge's (SyncBody::Kind,
HeadsSummary::Kind): a SYNC's body is one more of its shapes, another
kind's bytes; a STATUS's stamp is another kind's bytes after a byte no
Automerge stamp begins with. Nothing version 53 said changes, and
version 52 says neither (WireError::OtherKind). Two stamps of another
kind are the same where their bytes are.
A node holding an Automerge document passes over a body of another
kind: a peer holding one isn't let near it.
Diffstat (limited to 'src/swarm/sync.rs')
| -rw-r--r-- | src/swarm/sync.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index 65a02ea..c953752 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -405,6 +405,9 @@ pub(crate) async fn handle_sync( // Changes pushed along a tree (`SyncBody::Changes`): their heads and bytes, made // into the Automerge message that would have brought them (`Received::pushed`). let (payload, deflated, pushed) = match envelope.body { + // Of a document of another kind: none this node holds, which a peer holding + // one isn't let near (`peer::inbound`). + transport::SyncBody::Kind(_) => return Ok(()), transport::SyncBody::Message(payload) => (payload, false, None), transport::SyncBody::Deflated(payload) => (payload, true, None), transport::SyncBody::Changes { heads, changes } => { |
