根据编号为20239的注解及其回复,似乎https://go-review.googlesource.com/c/net/+/43230可能破坏了net/http.Server.SetKeepAlivesEnabled(false)
,导致HTTP/2服务器连接关闭。我想这没有测试。
/cc @tombergan@pam4
根据编号为20239的注解及其回复,似乎https://go-review.googlesource.com/c/net/+/43230可能破坏了net/http.Server.SetKeepAlivesEnabled(false)
,导致HTTP/2服务器连接关闭。我想这没有测试。
/cc @tombergan@pam4
3条答案
按热度按时间ma8fv8wu1#
在
serve_test.go
中有一个TestServerSetKeepAlivesEnabledClosesConns
,但它仅适用于HTTP/1。mm5n2pyu2#
https://golang.org/cl/122820提到了这个问题:
net/http: remove dead code noted in post-submit review of CL 81778
yrefmtwq3#
实际上,由于当前代码的工作原理,很难进行测试。h1ServerKeepAlivesDisabled检查一个接口,只有在http包内执行时才能正常工作。