]> Cypherpunks repositories - gostls13.git/commit
net: fix UDPConn readers to return truncated payload size instead of 0
authorMansour Rahimi <rahimi.mnr@gmail.com>
Wed, 7 Feb 2018 01:17:50 +0000 (02:17 +0100)
committerMikio Hara <mikioh.mikioh@gmail.com>
Wed, 21 Feb 2018 10:40:03 +0000 (10:40 +0000)
commit79fe895112dc3759506e57c519a2b38c41ee71dd
treed7e59317975beebe68eac36133bc349747632baf
parentcab7ba0b28d65bcb1d2a02ec945f43625869172e
net: fix UDPConn readers to return truncated payload size instead of 0

Calling UDPConn readers (Read, ReadFrom, ReadMsgUDP) to read part of
datagram returns error (in Windows), mentioning there is more data
available, and 0 as size of read data, even though part of data is
already read.

This fix makes UDPConn readers to return truncated payload size,
even there is error due more data available to read.

Fixes #14074
Updates #18056

Change-Id: Id7eec7f544dd759b2d970fa2561eef2937ec4662
Reviewed-on: https://go-review.googlesource.com/92475
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
src/internal/poll/fd_windows.go
src/net/net.go
src/net/timeout_test.go
src/net/udpsock_test.go
src/syscall/types_windows.go