From 2e9c5ddc33e12fcb8fc79db5e23e977c31d321a5 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 3 Jun 2019 12:06:49 +0100 Subject: [PATCH] Note on protocol problem --- packages/driver-streams-node/src/streams.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/driver-streams-node/src/streams.js b/packages/driver-streams-node/src/streams.js index 65f4c32..509d9ff 100644 --- a/packages/driver-streams-node/src/streams.js +++ b/packages/driver-streams-node/src/streams.js @@ -28,6 +28,11 @@ assertion type Incoming(spec); assertion type Outgoing(spec); message type Accepted(); // for both incoming and outgoing connections message type Rejected(err); // for both incoming and outgoing connections +// +// ^ TODO: This protocol is vulnerable to crashes between noticing +// interest in a new stream and sending Accepted or Rejected for it. +// There's no handshake assertion to signify "I see you want a new +// stream, hang on, I'm thinking about it". // Each `chunk` to/from a stream in BINARY mode must be either a // String or a Uint8Array (or Buffer). Any `chunk` may be empty