Fix race condition in registry/session
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
7d11fc6e5c
commit
767c5283a2
1 changed files with 5 additions and 1 deletions
|
@ -98,7 +98,11 @@ func (tr *authTransport) RoundTrip(orig *http.Request) (*http.Response, error) {
|
|||
}
|
||||
resp.Body = &transport.OnEOFReader{
|
||||
Rc: resp.Body,
|
||||
Fn: func() { delete(tr.modReq, orig) },
|
||||
Fn: func() {
|
||||
tr.mu.Lock()
|
||||
delete(tr.modReq, orig)
|
||||
tr.mu.Unlock()
|
||||
},
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue