mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
add more deadlines and pass around context under most situations (#19752)
This commit is contained in:
@@ -20,7 +20,9 @@ package grid
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
@@ -150,7 +152,7 @@ func (m *Manager) Handler() http.HandlerFunc {
|
||||
}
|
||||
ctx := req.Context()
|
||||
if err := m.authRequest(req); err != nil {
|
||||
gridLogOnceIf(ctx, fmt.Errorf("auth %s: %w", req.RemoteAddr, err), req.RemoteAddr+err.Error())
|
||||
gridLogOnceIf(ctx, fmt.Errorf("auth %s: %w", req.RemoteAddr, err), req.RemoteAddr)
|
||||
w.WriteHeader(http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
@@ -167,7 +169,10 @@ func (m *Manager) Handler() http.HandlerFunc {
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
gridLogOnceIf(ctx, err, err.Error())
|
||||
if errors.Is(err, io.EOF) {
|
||||
return
|
||||
}
|
||||
gridLogOnceIf(ctx, err, req.RemoteAddr)
|
||||
resp := connectResp{
|
||||
ID: m.ID,
|
||||
Accepted: false,
|
||||
|
||||
Reference in New Issue
Block a user