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