• Ian Lance Taylor's avatar
    os, net, internal/poll: return consistent error for closed socket · fb4b4342
    Ian Lance Taylor authored
    In the past we returned "use of closed network connection" when using
    a closed network descriptor in some way. In CL 36799 that was changed
    to return "use of closed file or network connection". Because programs
    have no access to a value of this error type (see issue #4373) they
    resort to doing direct string comparisons (see issue #19252). This CL
    restores the old error string so that we don't break programs
    unnecessarily with the 1.9 release.
    
    This adds a test to the net package for the expected string.
    
    For symmetry check that the os package returns the expected error,
    which for os already exists as os.ErrClosed.
    
    Updates #4373.
    Fixed #19252.
    
    Change-Id: I5b83fd12cfa03501a077cad9336499b819f4a38b
    Reviewed-on: https://go-review.googlesource.com/39997
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    fb4b4342
Name
Last commit
Last update
..
export_posix_test.go Loading commit data...
export_test.go Loading commit data...
fd.go Loading commit data...
fd_io_plan9.go Loading commit data...
fd_mutex.go Loading commit data...
fd_mutex_test.go Loading commit data...
fd_plan9.go Loading commit data...
fd_poll_nacl.go Loading commit data...
fd_poll_runtime.go Loading commit data...
fd_posix.go Loading commit data...
fd_posix_test.go Loading commit data...
fd_unix.go Loading commit data...
fd_windows.go Loading commit data...
hook_cloexec.go Loading commit data...
hook_unix.go Loading commit data...
hook_windows.go Loading commit data...
sendfile_bsd.go Loading commit data...
sendfile_linux.go Loading commit data...
sendfile_solaris.go Loading commit data...
sendfile_windows.go Loading commit data...
sock_cloexec.go Loading commit data...
sockopt.go Loading commit data...
sockopt_linux.go Loading commit data...
sockopt_unix.go Loading commit data...
sockopt_windows.go Loading commit data...
sockoptip.go Loading commit data...
strconv.go Loading commit data...
sys_cloexec.go Loading commit data...
writev.go Loading commit data...
writev_test.go Loading commit data...