Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
Eliminate some TODOs
Matthew Holt committed
Sep 14, 2019 at 18:05 UTC
f15f0d5839479f8511621b88fa4bdcca3b89cc32
9 files changed
+15
-15
caddy.go
+1
-1
@@ -93,7 +93,7 @@ func Run(newCfg *Config) error {
93
return fmt.Errorf("creating storage value: %v", err)
94
}
95
newCfg.storage = stor
96
- newCfg.StorageRaw = nil // allow GC to deallocate - TODO: Does this help?
96
+ newCfg.StorageRaw = nil // allow GC to deallocate
97
}
98
if newCfg.storage == nil {
99
newCfg.storage = &certmagic.FileStorage{Path: dataDir()}
modules/caddyhttp/encode/encode.go
+1
-1
@@ -68,7 +68,7 @@ func (enc *Encode) Provision(ctx caddy.Context) error {
68
return err
69
}
70
}
71
- enc.EncodingsRaw = nil // allow GC to deallocate - TODO: Does this help?
71
+ enc.EncodingsRaw = nil // allow GC to deallocate
72
73
if enc.MinLength == 0 {
74
enc.MinLength = defaultMinLength
modules/caddyhttp/matchers.go
+1
-1
@@ -418,7 +418,7 @@ func (m *MatchNegate) Provision(ctx caddy.Context) error {
418
}
419
m.matchers = append(m.matchers, val.(RequestMatcher))
420
}
421
- m.matchersRaw = nil // allow GC to deallocate - TODO: Does this help?
421
+ m.matchersRaw = nil // allow GC to deallocate
422
return nil
423
}
424
modules/caddyhttp/reverseproxy/reverseproxy.go
+3
-3
@@ -66,7 +66,7 @@ func (h *Handler) Provision(ctx caddy.Context) error {
66
return fmt.Errorf("loading transport module: %s", err)
67
}
68
h.Transport = val.(http.RoundTripper)
69
- h.TransportRaw = nil // allow GC to deallocate - TODO: Does this help?
69
+ h.TransportRaw = nil // allow GC to deallocate
70
}
71
if h.LoadBalancing != nil && h.LoadBalancing.SelectionPolicyRaw != nil {
72
val, err := ctx.LoadModuleInline("policy",
@@ -76,7 +76,7 @@ func (h *Handler) Provision(ctx caddy.Context) error {
76
return fmt.Errorf("loading load balancing selection module: %s", err)
77
}
78
h.LoadBalancing.SelectionPolicy = val.(Selector)
79
- h.LoadBalancing.SelectionPolicyRaw = nil // allow GC to deallocate - TODO: Does this help?
79
+ h.LoadBalancing.SelectionPolicyRaw = nil // allow GC to deallocate
80
}
81
if h.CBRaw != nil {
82
val, err := ctx.LoadModuleInline("type", "http.handlers.reverse_proxy.circuit_breakers", h.CBRaw)
@@ -84,7 +84,7 @@ func (h *Handler) Provision(ctx caddy.Context) error {
84
return fmt.Errorf("loading circuit breaker module: %s", err)
85
}
86
h.CB = val.(CircuitBreaker)
87
- h.CBRaw = nil // allow GC to deallocate - TODO: Does this help?
87
+ h.CBRaw = nil // allow GC to deallocate
88
}
89
90
if h.Transport == nil {
modules/caddyhttp/routes.go
+2
-2
@@ -91,7 +91,7 @@ func (routes RouteList) Provision(ctx caddy.Context) error {
91
}
92
routes[i].MatcherSets = append(routes[i].MatcherSets, matchers)
93
}
94
- routes[i].MatcherSetsRaw = nil // allow GC to deallocate - TODO: Does this help?
94
+ routes[i].MatcherSetsRaw = nil // allow GC to deallocate
95
96
// handlers
97
for j, rawMsg := range route.HandlersRaw {
@@ -101,7 +101,7 @@ func (routes RouteList) Provision(ctx caddy.Context) error {
101
}
102
routes[i].Handlers = append(routes[i].Handlers, mh.(MiddlewareHandler))
103
}
104
- routes[i].HandlersRaw = nil // allow GC to deallocate - TODO: Does this help?
104
+ routes[i].HandlersRaw = nil // allow GC to deallocate
105
}
106
return nil
107
}
modules/caddytls/acmemanager.go
+2
-2
@@ -74,7 +74,7 @@ func (m *ACMEManagerMaker) Provision(ctx caddy.Context) error {
74
return fmt.Errorf("loading DNS provider module: %s", err)
75
}
76
m.Challenges.DNS = val.(challenge.Provider)
77
- m.Challenges.DNSRaw = nil // allow GC to deallocate - TODO: Does this help?
77
+ m.Challenges.DNSRaw = nil // allow GC to deallocate
78
}
79
80
// policy-specific storage implementation
@@ -88,7 +88,7 @@ func (m *ACMEManagerMaker) Provision(ctx caddy.Context) error {
88
return fmt.Errorf("creating TLS storage configuration: %v", err)
89
}
90
m.storage = cmStorage
91
- m.Storage = nil // allow GC to deallocate - TODO: Does this help?
91
+ m.Storage = nil // allow GC to deallocate
92
}
93
94
return nil
modules/caddytls/connpolicy.go
+2
-2
@@ -46,7 +46,7 @@ func (cp ConnectionPolicies) TLSConfig(ctx caddy.Context) (*tls.Config, error) {
46
}
47
cp[i].matchers = append(cp[i].matchers, val.(ConnectionMatcher))
48
}
49
- cp[i].Matchers = nil // allow GC to deallocate - TODO: Does this help?
49
+ cp[i].Matchers = nil // allow GC to deallocate
50
51
// certificate selector
52
if pol.CertSelection != nil {
@@ -55,7 +55,7 @@ func (cp ConnectionPolicies) TLSConfig(ctx caddy.Context) (*tls.Config, error) {
55
return nil, fmt.Errorf("loading certificate selection module: %s", err)
56
}
57
cp[i].certSelector = val.(certmagic.CertificateSelector)
58
- cp[i].CertSelection = nil // allow GC to deallocate - TODO: Does this help?
58
+ cp[i].CertSelection = nil // allow GC to deallocate
59
}
60
}
61
modules/caddytls/sessiontickets.go
+1
-1
@@ -62,7 +62,7 @@ func (s *SessionTicketService) provision(ctx caddy.Context) error {
62
return fmt.Errorf("loading TLS session ticket ephemeral keys provider module: %s", err)
63
}
64
s.keySource = val.(STEKProvider)
65
- s.KeySource = nil // allow GC to deallocate - TODO: Does this help?
65
+ s.KeySource = nil // allow GC to deallocate
66
67
// if session tickets or just rotation are
68
// disabled, no need to start service
modules/caddytls/tls.go
+2
-2
@@ -71,7 +71,7 @@ func (t *TLS) Provision(ctx caddy.Context) error {
71
return fmt.Errorf("loading TLS automation management module: %s", err)
72
}
73
t.Automation.Policies[i].Management = val.(ManagerMaker)
74
- t.Automation.Policies[i].ManagementRaw = nil // allow GC to deallocate - TODO: Does this help?
74
+ t.Automation.Policies[i].ManagementRaw = nil // allow GC to deallocate
75
}
76
77
// certificate loaders
@@ -138,7 +138,7 @@ func (t *TLS) Start() error {
138
return fmt.Errorf("automate: managing %v: %v", names, err)
139
}
140
}
141
- t.Certificates = nil // allow GC to deallocate - TODO: Does this help?
141
+ t.Certificates = nil // allow GC to deallocate
142
143
return nil
144
}