@marcel91200 / caddy Mirror · read-only / commits / 076a8b80
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 13, 13:00 UTC

Very minor tweaks

Matthew Holt committed Sep 8, 2022 at 13:10 UTC 076a8b8095ad4e1a8f2ad770ce375612dcaf0288
2 files changed +5 -3
listeners.go
+4 -2
@@ -87,6 +87,7 @@ func ListenPacket(network, addr string) (net.PacketConn, error) {
87 // ListenQUIC returns a quic.EarlyListener suitable for use in a Caddy module.
88 // Note that the context passed to Accept is currently ignored, so using
89 // a context other than context.Background is meaningless.
90 +// This API is EXPERIMENTAL and may change.
91 func ListenQUIC(addr string, tlsConf *tls.Config, activeRequests *int64) (quic.EarlyListener, error) {
92 lnKey := listenerKey("udp", addr)
93
@@ -112,8 +113,9 @@ func ListenQUIC(addr string, tlsConf *tls.Config, activeRequests *int64) (quic.E
113 ctx, cancel := context.WithCancel(context.Background())
114 return &fakeCloseQuicListener{
115 sharedQuicListener: sharedEl.(*sharedQuicListener),
115 - context: ctx, contextCancel: cancel,
116 - }, err
116 + context: ctx,
117 + contextCancel: cancel,
118 + }, nil
119 }
120
121 // ListenerUsage returns the current usage count of the given listener address.
modules/caddyhttp/server.go
+1 -1
@@ -181,7 +181,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
181
182 // advertise HTTP/3, if enabled
183 if s.h3server != nil {
184 - // keep track of active requests for QUIC transport purposes (See AcceptToken callback in quic.Config)
184 + // keep track of active requests for QUIC transport purposes
185 atomic.AddInt64(&s.activeRequests, 1)
186 defer atomic.AddInt64(&s.activeRequests, -1)
187