Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: Fix race in baseHTTPListener.Addr()
There was a potential race with initializing a listener and saving the reference to it and using the reference when checking on the address for the listener. This change is doing two things: * Getting the address from the listener a single time _after_ it has been initialized. * Using a mutex to protect access to the address (common use-case being to start the listener on a background thread and check for the address it is listening on from another one). `go test -tags=slow -race -vet=off ./cmd/` is now passing with these changes. Signed-off-by: Patrick East <[email protected]>
- Loading branch information