fix: Use buffered reader in peer to fix ShortBuffer (#303)

This prevents a io.ErrShortBuffer from occurring when the byte
slice being read is smaller than the chunks sent from the opposite
pipe.

This makes sense for unordered connections, where transmission is
not guaranteed, but does not make sense for TCP-like connections.

We use a bufio.Reader when ordered to ensure data isn't lost.
This commit is contained in:
Kyle Carberry
2022-02-17 08:45:14 -06:00
committed by GitHub
parent deb717037d
commit d43699306b
3 changed files with 41 additions and 2 deletions
+1
View File
@@ -57,6 +57,7 @@
"tfexec",
"tfstate",
"unconvert",
"webrtc",
"xerrors",
"yamux"
]