mirror of
https://github.com/1f349/violet.git
synced 2024-12-21 23:14:04 +00:00
Try disabling keep alives
This commit is contained in:
parent
221a46cc55
commit
6a5be76db3
@ -49,6 +49,7 @@ func NewHybridTransportWithCalls(normal, insecure http.RoundTripper, ws *websock
|
||||
IdleConnTimeout: 30 * time.Second,
|
||||
ExpectContinueTimeout: 1 * time.Second,
|
||||
ResponseHeaderTimeout: 10 * time.Second,
|
||||
DisableKeepAlives: true,
|
||||
}
|
||||
}
|
||||
if h.insecureTransport == nil {
|
||||
@ -62,6 +63,7 @@ func NewHybridTransportWithCalls(normal, insecure http.RoundTripper, ws *websock
|
||||
ExpectContinueTimeout: 1 * time.Second,
|
||||
ResponseHeaderTimeout: 10 * time.Second,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
DisableKeepAlives: true,
|
||||
}
|
||||
}
|
||||
return h
|
||||
|
@ -1,6 +1,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
@ -10,7 +11,7 @@ import (
|
||||
// RunBackgroundHttp and RunBackgroundHttps.
|
||||
func logHttpServerError(prefix string, err error) {
|
||||
if err != nil {
|
||||
if err == http.ErrServerClosed {
|
||||
if errors.Is(err, http.ErrServerClosed) {
|
||||
log.Printf("[%s] The http server shutdown successfully\n", prefix)
|
||||
} else {
|
||||
log.Printf("[%s] Error trying to host the http server: %s\n", prefix, err.Error())
|
||||
|
Loading…
Reference in New Issue
Block a user