Do not accept websocket connection if response not received (#923)
When the instance handling the signal request did not respond to the initial connection, we will fail the connection attempt instead of having it hang forever.
This commit is contained in:
@@ -7,11 +7,11 @@ import (
|
||||
"github.com/livekit/protocol/logger"
|
||||
)
|
||||
|
||||
func handleError(w http.ResponseWriter, status int, msg string) {
|
||||
// GetLogger already with extra depth 1
|
||||
logger.GetLogger().V(1).Info("error handling request", "error", msg, "status", status)
|
||||
func handleError(w http.ResponseWriter, status int, err error, keysAndValues ...interface{}) {
|
||||
keysAndValues = append(keysAndValues, "status", status)
|
||||
logger.Warnw("error handling request", err, keysAndValues...)
|
||||
w.WriteHeader(status)
|
||||
_, _ = w.Write([]byte(msg))
|
||||
_, _ = w.Write([]byte(err.Error()))
|
||||
}
|
||||
|
||||
func boolValue(s string) bool {
|
||||
|
||||
Reference in New Issue
Block a user