diff options
author | David Fifield <david@bamsoftware.com> | 2023-11-21 03:46:46 +0000 |
---|---|---|
committer | David Fifield <david@bamsoftware.com> | 2023-11-21 03:46:46 +0000 |
commit | aa06e7bef33cae6eeb79cfbe15eb0deb6dbab392 (patch) | |
tree | 224390b9cd920f11743d0ea1315f09d5336955d1 /client | |
parent | 234d9cb11c304b0442c642f7440037075b7cd3f8 (diff) | |
parent | d99f31d881b00536f43cb212c65858f7905d4e09 (diff) | |
download | snowflake-aa06e7bef33cae6eeb79cfbe15eb0deb6dbab392.tar.gz snowflake-aa06e7bef33cae6eeb79cfbe15eb0deb6dbab392.zip |
Merge branch 'encapsulation-readdata-buffer'
Diffstat (limited to 'client')
-rw-r--r-- | client/lib/turbotunnel.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/lib/turbotunnel.go b/client/lib/turbotunnel.go index f2141e9..642b0d4 100644 --- a/client/lib/turbotunnel.go +++ b/client/lib/turbotunnel.go @@ -37,11 +37,11 @@ func newEncapsulationPacketConn( // ReadFrom reads an encapsulated packet from the stream. func (c *encapsulationPacketConn) ReadFrom(p []byte) (int, net.Addr, error) { - data, err := encapsulation.ReadData(c.ReadWriteCloser) - if err != nil { - return 0, c.remoteAddr, err + n, err := encapsulation.ReadData(c.ReadWriteCloser, p) + if err == io.ErrShortBuffer { + err = nil } - return copy(p, data), c.remoteAddr, nil + return n, c.remoteAddr, err } // WriteTo writes an encapsulated packet to the stream. |