mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 21:20:23 +03:00
Make ReqInfo concurrency safe (#15204)
Some read/writes of ReqInfo did not get appropriate locks, leading to races. Make sure reading and writing holds appropriate locks.
This commit is contained in:
@@ -149,7 +149,6 @@ func GetAuditEntry(ctx context.Context) *audit.Entry {
|
||||
DeploymentID: xhttp.GlobalDeploymentID,
|
||||
Time: time.Now().UTC(),
|
||||
}
|
||||
SetAuditEntry(ctx, r)
|
||||
return r
|
||||
}
|
||||
return nil
|
||||
@@ -168,6 +167,8 @@ func AuditLog(ctx context.Context, w http.ResponseWriter, r *http.Request, reqCl
|
||||
if reqInfo == nil {
|
||||
return
|
||||
}
|
||||
reqInfo.RLock()
|
||||
defer reqInfo.RUnlock()
|
||||
|
||||
entry = audit.ToEntry(w, r, reqClaims, xhttp.GlobalDeploymentID)
|
||||
// indicates all requests for this API call are inbound
|
||||
|
||||
Reference in New Issue
Block a user