]> Cypherpunks repositories - gostls13.git/commit
net: fix socket leak in case of Dial failure
authorChris Farmiloe <chrisfarms@gmail.com>
Tue, 11 Oct 2011 16:53:16 +0000 (12:53 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 11 Oct 2011 16:53:16 +0000 (12:53 -0400)
commit4b749567b8ceb441b27ba375c85d52f6297faea3
tree41c8cf697d1656deff4608f3da16b4c8d43fdb1c
parent1444a08098c4ae3001d0aa017f505a97bc006806
net: fix socket leak in case of Dial failure

Socket descriptors are not closed when fd.connect() fails during generic socket creation.
After a connection failure [ECONNREFUSED] descriptors are left in SYN_SENT state indefinitely (unless they get an explicit RST). Repeated failed connections will eventually cause your program to hit the user/system max-open-files limit.

Fixes #2349.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5229047
src/pkg/net/sock.go