about summary refs log tree commit diff stats
path: root/internal/server/tcp.go
diff options
context:
space:
mode:
authorAlan Pearce2024-06-28 16:54:42 +0200
committerAlan Pearce2024-06-28 16:54:42 +0200
commite29149ae9b0cd31f38beb38b0f4ea4e1599f4d93 (patch)
tree40f9f63157ad14d953a900f0971791c874c0a1ce /internal/server/tcp.go
parent5dcf04d83605f5cfe1bf83c0a4c296bae47c3365 (diff)
downloadwebsite-e29149ae9b0cd31f38beb38b0f4ea4e1599f4d93.tar.lz
website-e29149ae9b0cd31f38beb38b0f4ea4e1599f4d93.tar.zst
website-e29149ae9b0cd31f38beb38b0f4ea4e1599f4d93.zip
use socket passing also for TLS
Diffstat (limited to 'internal/server/tcp.go')
-rw-r--r--internal/server/tcp.go17
1 files changed, 2 insertions, 15 deletions
diff --git a/internal/server/tcp.go b/internal/server/tcp.go
index 4dc3314..b38da3d 100644
--- a/internal/server/tcp.go
+++ b/internal/server/tcp.go
@@ -1,26 +1,13 @@
 package server
 
 import (
-	"net"
-
 	"website/internal/listenfd"
-	"website/internal/log"
-
-	"github.com/pkg/errors"
 )
 
 func (s *Server) serveTCP() error {
-	l, err := listenfd.GetListener(0)
+	l, err := listenfd.GetListener(0, s.Addr)
 	if err != nil {
-		log.Warn("could not create listener from listenfd", "error", err)
-	}
-
-	log.Debug("listener from listenfd?", "passed", l != nil)
-	if l == nil {
-		l, err = net.Listen("tcp", s.Addr)
-		if err != nil {
-			return errors.Wrap(err, "could not create listener")
-		}
+		return err
 	}
 
 	return s.Serve(l)