This change addresses the POODLE vulnerability [0]. Unfortunately it
makes package graceful's behavior here slightly different than the stock
net/http methods of the same name, but I think that's fine in this
situation.
[0]: https://www.openssl.org/~bodo/ssl-poodle.pdf
Thanks to @ekanna for reporting this. Fixes#101.
This change refactors package graceful into two packages: one very well
tested package that deals with graceful shutdown of arbitrary
net.Listeners in the abstract, and one less-well-tested package that
works with the nitty-gritty details of net/http and signal handling.
This is a breaking API change for advanced users of package graceful:
the WrapConn function no longer exists. This shouldn't affect most users
or use cases.
This feature can be used in place of the pile of hacks in middleware.go,
and doesn't involve awkwardly shimming out a http.ResponseWriter. Sounds
like a win-win!
graceful.Server was made private in 05c2ca7e, but I think the increased
flexibility you get with being able to provide your own TLS options
(etc.) outweighs the API complexity of an additional type.
Package graceful provides graceful shutdown support for net/http servers,
net.Listeners and net.Conns. It does this through terrible, terrible hacks, but
"oh well!"