MCPcopy
hub / github.com/caddyserver/certmagic / CleanUp

Method CleanUp

solvers.go:106–121  ·  view source on GitHub ↗

CleanUp cleans up the HTTP server if it is the last one to finish.

(_ context.Context, _ acme.Challenge)

Source from the content-addressed store, hash-verified

104
105// CleanUp cleans up the HTTP server if it is the last one to finish.
106func (s *httpSolver) CleanUp(_ context.Context, _ acme.Challenge) error {
107 solversMu.Lock()
108 defer solversMu.Unlock()
109 si := getSolverInfo(s.address)
110 si.count--
111 if si.count == 0 {
112 // last one out turns off the lights
113 atomic.StoreInt32(&s.closed, 1)
114 if si.listener != nil {
115 si.listener.Close()
116 <-si.done
117 }
118 delete(solvers, s.address)
119 }
120 return nil
121}
122
123// tlsALPNSolver is a type that can solve TLS-ALPN challenges.
124// It must have an associated config and address on which to

Callers 3

CleanUpMethod · 0.45
CleanUpMethod · 0.45
IssueMethod · 0.45

Calls 4

getSolverInfoFunction · 0.85
CloseMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected