summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2022-09-08 13:10:40 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2022-09-08 13:10:40 -0600
commit076a8b8095ad4e1a8f2ad770ce375612dcaf0288 (patch)
treed3b22691b4e3294dcbb90374d16c0d75f922f682
parent50748e19c34fc90882bbb268c95a2a0acb051752 (diff)
Very minor tweaks
-rw-r--r--listeners.go6
-rw-r--r--modules/caddyhttp/server.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/listeners.go b/listeners.go
index b494910..6a23c61 100644
--- a/listeners.go
+++ b/listeners.go
@@ -87,6 +87,7 @@ func ListenPacket(network, addr string) (net.PacketConn, error) {
// ListenQUIC returns a quic.EarlyListener suitable for use in a Caddy module.
// Note that the context passed to Accept is currently ignored, so using
// a context other than context.Background is meaningless.
+// This API is EXPERIMENTAL and may change.
func ListenQUIC(addr string, tlsConf *tls.Config, activeRequests *int64) (quic.EarlyListener, error) {
lnKey := listenerKey("udp", addr)
@@ -112,8 +113,9 @@ func ListenQUIC(addr string, tlsConf *tls.Config, activeRequests *int64) (quic.E
ctx, cancel := context.WithCancel(context.Background())
return &fakeCloseQuicListener{
sharedQuicListener: sharedEl.(*sharedQuicListener),
- context: ctx, contextCancel: cancel,
- }, err
+ context: ctx,
+ contextCancel: cancel,
+ }, nil
}
// ListenerUsage returns the current usage count of the given listener address.
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go
index e2da531..f1909c4 100644
--- a/modules/caddyhttp/server.go
+++ b/modules/caddyhttp/server.go
@@ -181,7 +181,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// advertise HTTP/3, if enabled
if s.h3server != nil {
- // keep track of active requests for QUIC transport purposes (See AcceptToken callback in quic.Config)
+ // keep track of active requests for QUIC transport purposes
atomic.AddInt64(&s.activeRequests, 1)
defer atomic.AddInt64(&s.activeRequests, -1)