]> Cypherpunks repositories - gostls13.git/commit
net: fix for DialTimeout errors with large timeout
authorPrashant Varanasi <prashant@prashantv.com>
Sat, 20 Feb 2016 17:43:15 +0000 (09:43 -0800)
committerMikio Hara <mikioh.mikioh@gmail.com>
Tue, 23 Feb 2016 22:48:04 +0000 (22:48 +0000)
commitc4cb365ea23f4e3bd571f63a16d59ad6c01df145
tree62ecd80316d515ea1936f9a3b8eb3256193887d6
parentd1cc7f70cdd4c99e821165b0e773e748a438f5b8
net: fix for DialTimeout errors with large timeout

The existing implementation converts the deadline time to an int64,
but does not handle overflow. If the calculated deadline is negative
but the user specified deadline is in the future, then we can assume
the calculation overflowed, and set the deadline to math.MaxInt64.

Fixes #14431

Change-Id: I54dbb4f02bc7ffb9cae8cf62e4e967e9c6541ec6
Reviewed-on: https://go-review.googlesource.com/19758
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
src/net/fd_poll_runtime.go
src/net/timeout_test.go