mirror of
https://github.com/servo/servo
synced 2026-05-12 18:06:32 +02:00
Introduces a new type `DevtoolsConnection`, which implements the `JsonPacketStream` trait with proper coordination of I/O across threads. This replaces the implementation of `JsonPacketStream` for raw `TcpStream`s, which was susceptible to interleaving writes when cloned across threads. `DevtoolsConnection` also defensively synchronizes read operations. These are less likely to cause issues: in practice actors should never independently pull incoming messages without centralized coordination. Testing: No new tests, as interleaving writes are difficult to evoke deterministically. Removing the `JsonPacketStream` implementation for `TcpStream` should discourage regressions due to improper use of raw streams. --------- Signed-off-by: Brent Schroeter <contact@brentsch.com> Co-authored-by: eri <eri@igalia.com>