Skip to content

Commit

Permalink
Fix race condition in registry/session
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Jun 1, 2015
1 parent 64a7431 commit 9d98c28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion registry/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9d98c28

Please sign in to comment.