mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
Appease linter
This commit is contained in:
parent
9563666bfb
commit
2b2addebb8
2 changed files with 20 additions and 20 deletions
20
listeners.go
20
listeners.go
|
@ -694,26 +694,6 @@ func RegisterNetwork(network string, getListener ListenerFunc) {
|
|||
networkTypes[network] = getListener
|
||||
}
|
||||
|
||||
type unixListener struct {
|
||||
*net.UnixListener
|
||||
mapKey string
|
||||
count *int32 // accessed atomically
|
||||
}
|
||||
|
||||
func (uln *unixListener) Close() error {
|
||||
newCount := atomic.AddInt32(uln.count, -1)
|
||||
if newCount == 0 {
|
||||
defer func() {
|
||||
addr := uln.Addr().String()
|
||||
unixSocketsMu.Lock()
|
||||
delete(unixSockets, uln.mapKey)
|
||||
unixSocketsMu.Unlock()
|
||||
_ = syscall.Unlink(addr)
|
||||
}()
|
||||
}
|
||||
return uln.UnixListener.Close()
|
||||
}
|
||||
|
||||
type unixConn struct {
|
||||
*net.UnixConn
|
||||
filename string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue