Skip to content
Snippets Groups Projects
Commit a1bb2db9 authored by ale's avatar ale
Browse files

Upgrade go-common: handle a nil pointer deref

parent 7c1711be
No related branches found
No related tags found
No related merge requests found
...@@ -60,20 +60,19 @@ func (config *ServerConfig) buildHTTPServer(h http.Handler) (*http.Server, error ...@@ -60,20 +60,19 @@ func (config *ServerConfig) buildHTTPServer(h http.Handler) (*http.Server, error
if config.MaxInflightRequests > 0 { if config.MaxInflightRequests > 0 {
h = newLoadSheddingWrapper(config.MaxInflightRequests, h) h = newLoadSheddingWrapper(config.MaxInflightRequests, h)
} }
}
// Wrap the handler with a TimeoutHandler if 'request_timeout' // Wrap the handler with a TimeoutHandler if 'request_timeout'
// is set. // is set.
h = addDefaultHandlers(h) if config.RequestTimeoutSecs > 0 {
if config.RequestTimeoutSecs > 0 { h = http.TimeoutHandler(h, time.Duration(config.RequestTimeoutSecs)*time.Second, "")
h = http.TimeoutHandler(h, time.Duration(config.RequestTimeoutSecs)*time.Second, "") }
} }
// These are not meant to be external-facing servers, so we // These are not meant to be external-facing servers, so we
// can be generous with the timeouts to keep the number of // can be generous with the timeouts to keep the number of
// reconnections low. // reconnections low.
return &http.Server{ return &http.Server{
Handler: h, Handler: addDefaultHandlers(h),
ReadTimeout: 30 * time.Second, ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second, WriteTimeout: 30 * time.Second,
IdleTimeout: 600 * time.Second, IdleTimeout: 600 * time.Second,
......
...@@ -5,26 +5,26 @@ ...@@ -5,26 +5,26 @@
{ {
"checksumSHA1": "oUOxU+Tw1/jOzWVP05HuGvVSC/A=", "checksumSHA1": "oUOxU+Tw1/jOzWVP05HuGvVSC/A=",
"path": "git.autistici.org/ai3/go-common", "path": "git.autistici.org/ai3/go-common",
"revision": "d4396660b1f09d2d07a7271b8a480726c5d29a6e", "revision": "29b9513a8afbdbda061208c8de63a2fa1bdf0bf4",
"revisionTime": "2020-02-06T11:03:59Z" "revisionTime": "2020-02-06T18:11:03Z"
}, },
{ {
"checksumSHA1": "/uo2RHmQ/sae2RMYKm81zb6OUn4=", "checksumSHA1": "/uo2RHmQ/sae2RMYKm81zb6OUn4=",
"path": "git.autistici.org/ai3/go-common/clientutil", "path": "git.autistici.org/ai3/go-common/clientutil",
"revision": "d4396660b1f09d2d07a7271b8a480726c5d29a6e", "revision": "29b9513a8afbdbda061208c8de63a2fa1bdf0bf4",
"revisionTime": "2020-02-06T11:03:59Z" "revisionTime": "2020-02-06T18:11:03Z"
}, },
{ {
"checksumSHA1": "xrew5jDNLDh5bhTZ4jgO0rX0N+4=", "checksumSHA1": "Gf1Ot7BviUta2ttp00G0wEissMk=",
"path": "git.autistici.org/ai3/go-common/serverutil", "path": "git.autistici.org/ai3/go-common/serverutil",
"revision": "d4396660b1f09d2d07a7271b8a480726c5d29a6e", "revision": "29b9513a8afbdbda061208c8de63a2fa1bdf0bf4",
"revisionTime": "2020-02-06T11:03:59Z" "revisionTime": "2020-02-06T18:11:03Z"
}, },
{ {
"checksumSHA1": "y5pRYZ/NhfEOCFslPEuUZTYXcro=", "checksumSHA1": "y5pRYZ/NhfEOCFslPEuUZTYXcro=",
"path": "git.autistici.org/ai3/go-common/tracing", "path": "git.autistici.org/ai3/go-common/tracing",
"revision": "d4396660b1f09d2d07a7271b8a480726c5d29a6e", "revision": "29b9513a8afbdbda061208c8de63a2fa1bdf0bf4",
"revisionTime": "2020-02-06T11:03:59Z" "revisionTime": "2020-02-06T18:11:03Z"
}, },
{ {
"checksumSHA1": "5WLGZjUV9Ly/rMdQwo9j8FJSlQA=", "checksumSHA1": "5WLGZjUV9Ly/rMdQwo9j8FJSlQA=",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment