Fix race condition in registry/session

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 9d98c28855035ba1a968f2031f50302d0c41e208
Component: engine
This commit is contained in:
Alexander Morozov
2015-06-01 13:25:18 -07:00
parent 869144dea2
commit a965e4e763

View File

@ -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
}