"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/server/server_entrypoint_tcp_test.go" between
traefik-v2.3.2.src.tar.gz and traefik-v2.3.3.src.tar.gz

About: Traefik is a cloud native edge router, a reverse proxy and load balancer for HTTP and TCP-based applications.

server_entrypoint_tcp_test.go  (traefik-v2.3.2.src):server_entrypoint_tcp_test.go  (traefik-v2.3.3.src)
skipping to change at line 49 skipping to change at line 49
})) }))
testShutdown(t, router) testShutdown(t, router)
} }
func TestShutdownTCP(t *testing.T) { func TestShutdownTCP(t *testing.T) {
router := &tcp.Router{} router := &tcp.Router{}
router.AddCatchAllNoTLS(tcp.HandlerFunc(func(conn tcp.WriteCloser) { router.AddCatchAllNoTLS(tcp.HandlerFunc(func(conn tcp.WriteCloser) {
for { for {
_, err := http.ReadRequest(bufio.NewReader(conn)) _, err := http.ReadRequest(bufio.NewReader(conn))
if err == io.EOF || (err != nil && strings.HasSuffix(err. Error(), "use of closed network connection")) { if errors.Is(err, io.EOF) || (err != nil && strings.HasSu ffix(err.Error(), "use of closed network connection")) {
return return
} }
require.NoError(t, err) require.NoError(t, err)
resp := http.Response{StatusCode: http.StatusOK} resp := http.Response{StatusCode: http.StatusOK}
err = resp.Write(conn) err = resp.Write(conn)
require.NoError(t, err) require.NoError(t, err)
} }
})) }))
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)