Main change is in server Shutdown method semantics: upon call Serve (or LintenAndServe will exit immediately but Shutdown will block until all outstanding transfers are completed or timed out.
Hopefully it is effectively unnoticeable change for downstream code, but allows more straight-forward code, when Serve called in goroutine as e.g.:
go s.Serve(conn)
This become similar to Golang HTTP server shutdown logic.
Fixes #87
TestHookSuccess runs one request and check that hook was called. That test its flaky because server exits before goroutine executes a hook.
This change makes Shutdown blocking so when it completes the server is stopped all operations.
Main change is in server
Shutdown
method semantics: upon callServe
(orLintenAndServe
will exit immediately butShutdown
will block until all outstanding transfers are completed or timed out.Hopefully it is effectively unnoticeable change for downstream code, but allows more straight-forward code, when
Serve
called in goroutine as e.g.:This become similar to Golang HTTP server shutdown logic.
Fixes #87
TestHookSuccess
runs one request and check that hook was called. That test its flaky because server exits before goroutine executes a hook.This change makes
Shutdown
blocking so when it completes the server is stopped all operations.