Protokoll v2: binäre Frames statt JSON (inkompatibel) #32
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/binary-wire-format"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #12
Änderung
Bisher war jeder Frame ein JSON-Envelope, in dem das mDNS-Paket als Zahlen-Array stand. Dadurch war ein Frame 3–4× so groß wie das Paket. Neu (
src/protocol.rs):matched_serviceist entfernt (war immer leer).PROTOCOL_VERSIONist jetzt 2.Inkompatibel: Der Handshake lehnt v1-Peers ab. Beide Seiten melden dann
protocol version mismatch: this side speaks v2, peer v1. Bis beide Standorte aktualisiert sind, wird zwischen ihnen nichts weitergeleitet. Die Verbindungsversuche laufen mit Backoff bis 30 s weiter, danach verbindet es sich von selbst. Die README hat einen neuen Abschnitt „Protocol versions“.Tests
authenticated.Danach
Merge, dann beide Standorte aktualisieren. Danach kann v0.1.0 getaggt werden.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Vh6img4RYU1F52VUwGJcrp
Frames carried the mDNS packet as a JSON array of numbers, 3-4 times its size. Version 2 sends a fixed binary header and the packet verbatim: frame = length:u32 body body = type:u8 (0x01 = packet) origin_site:u32 path_len:u8 path:u32*path_len mdns_packet The unused matched_service field is gone. PROTOCOL_VERSION is now 2, so a v1 peer is rejected in the handshake with "protocol version mismatch: this side speaks v2, peer v1" on both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh6img4RYU1F52VUwGJcrp