2017-10-26 22:52:29 +02:00
|
|
|
// HTTP parts go1.8+
|
|
|
|
|
|
|
|
//+build go1.8
|
|
|
|
|
2018-02-14 21:39:11 +01:00
|
|
|
package httplib
|
2017-10-26 22:52:29 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2018-02-14 21:39:11 +01:00
|
|
|
// Initialise the http.Server for post go1.8
|
2017-10-26 22:52:29 +02:00
|
|
|
func initServer(s *http.Server) {
|
|
|
|
s.ReadHeaderTimeout = 10 * time.Second // time to send the headers
|
|
|
|
s.IdleTimeout = 60 * time.Second // time to keep idle connections open
|
|
|
|
}
|
2018-02-19 15:02:19 +01:00
|
|
|
|
|
|
|
// closeServer closes the server in a non graceful way
|
|
|
|
func closeServer(s *http.Server) error {
|
|
|
|
return s.Close()
|
|
|
|
}
|