1
0
mirror of https://github.com/golang/go synced 2024-10-05 09:21:22 -06:00
go/src/net
Brad Fitzpatrick 4b0bc7c3a1 net/http: relax recently-updated rules and behavior of CloseNotifier
The CloseNotifier implementation and documentation was
substantially changed in https://golang.org/cl/17750 but it was a bit
too aggressive.

Issue #13666 highlighted that in addition to breaking external
projects, even the standard library (httputil.ReverseProxy) didn't
obey the new rules about not using CloseNotifier until the
Request.Body is fully consumed.

So, instead of fixing httputil.ReverseProxy, dial back the rules a
bit. It's now okay to call CloseNotify before consuming the request
body. The docs now say CloseNotifier may wait to fire before the
request body is fully consumed, but doesn't say that the behavior is
undefined anymore. Instead, we just wait until the request body is
consumed and start watching for EOF from the client then.

This CL also adds a test to ReverseProxy (using a POST request) that
would've caught this earlier.

Fixes #13666

Change-Id: Ib4e8c29c4bfbe7511f591cf9ffcda23a0f0b1269
Reviewed-on: https://go-review.googlesource.com/18144
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-05 04:39:11 +00:00
..
http net/http: relax recently-updated rules and behavior of CloseNotifier 2016-01-05 04:39:11 +00:00
internal/socktest net/internal/socktest: simplify log message format 2015-12-22 03:38:51 +00:00
mail net/mail: do not parse RFC 2047 tokens in quoted strings 2015-12-04 16:11:09 +00:00
rpc net/rpc: verify that embedding works with changed semantics 2015-11-13 19:47:35 +00:00
smtp net/smtp: give example addrs in docs 2015-07-15 05:34:29 +00:00
testdata net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
textproto net/textproto: properly trim continued lines in MIME headers 2015-10-11 16:46:15 +00:00
url net/url: fix RFC typo in comments 2015-12-16 19:19:36 +00:00
addrselect_test.go net: fix IPv4 address selection 2015-11-17 23:48:43 +00:00
addrselect.go net: fix IPv4 address selection 2015-11-17 23:48:43 +00:00
cgo_android.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_bsd.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_linux.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_netbsd.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_openbsd.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_resnew.go net: fix build on android 2015-06-18 00:45:12 +00:00
cgo_resold.go net: fix build on android 2015-06-18 00:45:12 +00:00
cgo_socknew.go net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
cgo_sockold.go net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
cgo_solaris.go net: add -lsendfile to cgo LDFLAGS for solaris 2015-08-30 22:01:07 +00:00
cgo_stub.go net: add mechanisms to force go or cgo lookup, and to debug default strategy 2015-07-09 22:19:41 +00:00
cgo_unix_test.go net: enable cgo test on solaris 2015-05-09 02:58:50 +00:00
cgo_unix.go net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
cgo_windows.go net: clean up cgo 2015-04-17 23:19:19 +00:00
conf_netcgo.go net: add mechanisms to force go or cgo lookup, and to debug default strategy 2015-07-09 22:19:41 +00:00
conf_test.go net: add mechanisms to force go or cgo lookup, and to debug default strategy 2015-07-09 22:19:41 +00:00
conf.go net: remove imports of strconv 2015-10-05 22:39:12 +00:00
conn_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
dial_gen.go net: add Source field to OpError 2015-04-29 22:37:30 +00:00
dial_test.go net: retighten test harnesses for dial cancelation 2015-12-16 01:05:47 +00:00
dial.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
dnsclient_test.go net: don't require recursion be available in DNS responses 2015-11-17 20:11:22 +00:00
dnsclient_unix_test.go net: fix race in test 2015-12-17 17:26:30 +00:00
dnsclient_unix.go net: fix the build even harder 2015-12-17 18:43:12 +00:00
dnsclient.go net: force LookupAddr results to be rooted DNS paths even in the case of local source 2015-11-28 08:43:55 +00:00
dnsconfig_unix_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
dnsconfig_unix.go net: make go DNS use localhost if resolv.conf is missing or empty 2015-04-30 18:19:00 +00:00
dnsmsg_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
dnsmsg.go net: check 'ok' return in dnsmsg when initially packing rr.Header() 2015-09-20 02:55:16 +00:00
dnsname_test.go net: simplify sync.Once calls in tests 2015-05-14 01:47:35 +00:00
error_plan9_test.go net: deflake timeout, deadline tests 2015-04-29 23:37:21 +00:00
error_posix_test.go net: make spuriousENOTAVAIL to be able to parse EADDRNOTAVAIL correctly 2015-07-28 11:52:56 +00:00
error_test.go net: retighten test harnesses for dial cancelation 2015-12-16 01:05:47 +00:00
example_test.go
external_test.go net: fix the series of TestLookup and external tests 2015-05-20 07:54:37 +00:00
fd_mutex_test.go
fd_mutex.go
fd_plan9.go net: unblock plan9 TCP Read calls after socket close 2015-10-16 19:16:56 +00:00
fd_poll_nacl.go net: remove the dregs of old built-in poll server 2015-02-04 10:16:38 +00:00
fd_poll_runtime.go net: remove the dregs of old built-in poll server 2015-02-04 10:16:38 +00:00
fd_posix_test.go net: don't return io.EOF on reading data from datagram, raw sockets on windows 2015-01-01 05:21:32 +00:00
fd_posix.go net: don't return io.EOF on reading data from datagram, raw sockets on windows 2015-01-01 05:21:32 +00:00
fd_unix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
fd_windows.go net: make windows (*netFD).connect work like its unix version 2015-12-16 23:51:38 +00:00
file_plan9.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
file_stub.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
file_test.go net: add missing File{Conn,Listener,PacketConn} read/write tests 2015-12-14 03:14:53 +00:00
file_unix.go net: do not unlink unix socket in UnixListener created from fd 2015-12-11 04:43:44 +00:00
file_windows.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
file.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
hook_cloexec.go net: add socket system call hooks for testing 2015-03-31 23:07:42 +00:00
hook_plan9.go net: deflake TestDialTimeout 2015-04-02 01:04:49 +00:00
hook_unix.go net: fix the build even harder 2015-12-17 18:43:12 +00:00
hook_windows.go net: add Listen system call hook for testing 2015-04-15 11:47:49 +00:00
hook.go net: fix build 2015-12-17 16:06:58 +00:00
hosts_test.go net: force LookupAddr results to be rooted DNS paths even in the case of local source 2015-11-28 08:43:55 +00:00
hosts.go net: force LookupAddr results to be rooted DNS paths even in the case of local source 2015-11-28 08:43:55 +00:00
interface_bsd_test.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_bsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_darwin.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_dragonfly.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_freebsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_linux_test.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_linux.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_netbsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_openbsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_stub.go
interface_test.go net: make use of IPv4 for parsing routing information on windows 2015-12-19 10:00:04 +00:00
interface_unix_test.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_windows_test.go net, internal/syscall/windows: fix interface and address identification on windows 2015-12-10 08:04:07 +00:00
interface_windows.go net: make use of IPv4 for parsing routing information on windows 2015-12-19 10:00:04 +00:00
interface.go net: add Source field to OpError 2015-04-29 22:37:30 +00:00
ip_test.go net: do not look up abc by default 2015-07-22 20:29:02 +00:00
ip.go net: fix misidentification of link-local, global unicast IP addresses 2015-07-10 07:30:33 +00:00
ipraw_test.go net: ensure that ResolveIPAddr(addr.String()) reproduces addr 2015-07-10 06:51:55 +00:00
iprawsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
iprawsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
iprawsock.go net: ensure that ResolveIPAddr(addr.String()) reproduces addr 2015-07-10 06:51:55 +00:00
ipsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
ipsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
ipsock_test.go net: don't run IP stack required tests on IP stack disabled kernels 2015-05-07 01:50:23 +00:00
ipsock.go net: make Dial, Listen{,Packet} for TCP/UDP with invalid port fail 2015-11-01 05:28:17 +00:00
listen_test.go net: don't run multicast listen test on nil interface in short mode 2015-11-21 01:33:40 +00:00
lookup_plan9.go net: return rooted DNS names on Plan 9 2015-12-04 01:47:18 +00:00
lookup_stub.go net: LookupHost and Resolve{TCP,UDP,IP}Addr should use zone from getaddrinfo 2015-03-08 09:58:11 +00:00
lookup_test.go net: make LookupPort with empty service mean 0 2015-12-14 20:41:36 +00:00
lookup_unix.go net: respect go vs cgo resolver selection in all lookup routines 2015-08-19 04:20:37 +00:00
lookup_windows_test.go net: return rooted DNS names on windows 2015-12-03 01:44:43 +00:00
lookup_windows.go net: return rooted DNS names on windows 2015-12-03 01:44:43 +00:00
lookup.go net: make LookupPort with empty service mean 0 2015-12-14 20:41:36 +00:00
mac_test.go net: allow ParseMAC to parse 20-octet IPoIB link-layer address 2015-08-24 16:34:43 +00:00
mac.go net: allow ParseMAC to parse 20-octet IPoIB link-layer address 2015-08-24 16:34:43 +00:00
main_cloexec_test.go net: add socket system call hooks for testing 2015-03-31 23:07:42 +00:00
main_plan9_test.go net: deflake TestDialGoogle, TestResolveDialGoogle 2015-04-03 01:50:30 +00:00
main_posix_test.go net: fix TestDialGoogle with -ipv6 when CGO_ENABLED=0 2015-04-16 00:44:52 +00:00
main_test.go net: adjust dual stack support on dragonfly 2015-05-23 05:22:57 +00:00
main_unix_test.go net: add Listen system call hook for testing 2015-04-15 11:47:49 +00:00
main_windows_test.go net: add Listen system call hook for testing 2015-04-15 11:47:49 +00:00
mockserver_test.go net: fix panic in TestDialerDualStack 2015-05-22 03:27:59 +00:00
net_test.go net: use t.Fatalf, not t.Fatal, in test 2015-11-18 21:55:38 +00:00
net_windows_test.go net: adjust TestInterfaceHardwareAddrWithGetmac 2015-12-19 09:05:38 +00:00
net.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
netgo_unix_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
non_unix_test.go net: force LookupAddr results to be rooted DNS paths even in the case of local source 2015-11-28 08:43:55 +00:00
nss_test.go net: use Go's DNS resolver when system configuration permits 2015-04-23 02:48:43 +00:00
nss.go net: use Go's DNS resolver when system configuration permits 2015-04-23 02:48:43 +00:00
packetconn_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
parse_test.go net: make Dial, Listen{,Packet} for TCP/UDP with invalid port fail 2015-11-01 05:28:17 +00:00
parse.go net: make Dial, Listen{,Packet} for TCP/UDP with invalid port fail 2015-11-01 05:28:17 +00:00
pipe_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
pipe.go net: add Source field to OpError 2015-04-29 22:37:30 +00:00
platform_test.go net: android no longer supports unix/unixgram 2015-10-19 19:27:22 +00:00
port_unix.go net: fix inconsistent error values on Lookup 2015-04-21 05:16:07 +00:00
protoconn_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
sendfile_dragonfly.go net: fix comment in sendFile 2015-05-06 12:27:07 +00:00
sendfile_freebsd.go net: fix comment in sendFile 2015-05-06 12:27:07 +00:00
sendfile_linux.go net: fix comment in sendFile 2015-05-06 12:27:07 +00:00
sendfile_solaris.go net: fix inconsistent error values on Read for solaris 2015-05-06 12:43:45 +00:00
sendfile_stub.go syscall, net: use sendfile on Solaris 2015-05-06 12:26:35 +00:00
sendfile_windows.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
server_test.go net: Make Listen(":port") use IPv6 when IPv4 is not supported. 2015-09-05 02:31:22 +00:00
sock_bsd.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
sock_cloexec.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
sock_linux.go
sock_plan9.go
sock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
sock_stub.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
sock_windows.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
sockopt_bsd.go net: adjust dual stack support on dragonfly 2015-05-23 05:22:57 +00:00
sockopt_linux.go
sockopt_plan9.go
sockopt_posix.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
sockopt_solaris.go
sockopt_stub.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
sockopt_windows.go
sockoptip_bsd.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
sockoptip_linux.go
sockoptip_posix.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
sockoptip_stub.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
sockoptip_windows.go
sys_cloexec.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
tcp_test.go net: fix race in TestTCPStress 2015-12-22 03:39:39 +00:00
tcpsock_plan9.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
tcpsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
tcpsock.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
tcpsockopt_darwin.go net: fix inconsistent behavior across platforms in SetKeepAlivePeriod 2014-09-11 17:56:58 +09:00
tcpsockopt_dragonfly.go net: fix inconsistent behavior across platforms in SetKeepAlivePeriod 2014-09-11 17:56:58 +09:00
tcpsockopt_openbsd.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
tcpsockopt_plan9.go net: remove imports of strconv 2015-10-05 22:39:12 +00:00
tcpsockopt_posix.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
tcpsockopt_solaris.go net: try to fix setKeepAlivePeriod on Solaris 2015-05-06 12:03:20 +00:00
tcpsockopt_stub.go net: separate NaCl dependent placeholders from BSD's 2014-09-18 19:17:55 +09:00
tcpsockopt_unix.go net: try to fix setKeepAlivePeriod on Solaris 2015-05-06 12:03:20 +00:00
tcpsockopt_windows.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
timeout_test.go net: deflake TestDialTimeout{,FDLeak} in the case of TCP simultaneous open 2015-07-27 16:09:26 +00:00
udp_test.go net: adjust dual stack support on dragonfly 2015-05-23 05:22:57 +00:00
udpsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
udpsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
udpsock.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
unix_test.go net: add test for CL 17458 2015-12-14 20:37:42 +00:00
unixsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
unixsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
unixsock.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00