diff --git a/node/bindata.go b/node/bindata.go index f83a365ba5675ec2844d0610178b9dd9fdd8fbd7..6339d52f3cbd64a166cc492af0ae9e18ab794ed5 100644 --- a/node/bindata.go +++ b/node/bindata.go @@ -552,7 +552,7 @@ var _templatesIndexHtml = []byte(`<!DOCTYPE html> <div class="row"> <p> <small> - Click on a stream to listen to it.<br> + Click on a stream to listen to it. Hover on a stream to see more details. </small> </p> @@ -583,7 +583,7 @@ func templatesIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/index.html", size: 2968, mode: os.FileMode(420), modTime: time.Unix(1581689120, 0)} + info := bindataFileInfo{name: "templates/index.html", size: 2964, mode: os.FileMode(420), modTime: time.Unix(1582995315, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/node/proxy.go b/node/proxy.go index 97e0ebe58f628e79d97b4d7059058d9256a1f4da..b9176e54fe7f393c5877b204bb37c65f970665a2 100644 --- a/node/proxy.go +++ b/node/proxy.go @@ -112,14 +112,17 @@ func doIcecastProxy(rw http.ResponseWriter, req *http.Request, target *url.URL, return } defer upstream.Close() - upstream.SetDeadline(time.Now().Add(requestWriteTimeout)) // nolint: errcheck + // Send the request upstream, with a timeout so we don't get + // stuck on unresponsive TCP servers. + upstream.SetDeadline(time.Now().Add(requestWriteTimeout)) // nolint: errcheck if err := outreq.Write(upstream); err != nil { log.Printf("http: proxy request write error: %v", err) rw.WriteHeader(http.StatusInternalServerError) proxyConnectErrs.WithLabelValues(streamName, target.Host).Inc() return } + upstream.SetDeadline(time.Time{}) // nolint: errcheck // Hijack the request connection. We might need to unroll the // layers of nested WrappedWriters, until we find a diff --git a/node/proxy_test.go b/node/proxy_test.go index 9f09f6f24736be7697530dbcf64918a6ee4f20e2..e0a319155482969081ddfd8214eba4ae873b1a6b 100644 --- a/node/proxy_test.go +++ b/node/proxy_test.go @@ -114,8 +114,8 @@ func TestProxy(t *testing.T) { }() } - // Now wait 10 seconds. - time.Sleep(10 * time.Second) + // Now wait 30 seconds, longer than request timeouts. + time.Sleep(30 * time.Second) stopProxyTest() for i := 0; i < streams; i++ {