summaryrefslogtreecommitdiff
path: root/gemini/serve.go
diff options
context:
space:
mode:
Diffstat (limited to 'gemini/serve.go')
-rw-r--r--gemini/serve.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/gemini/serve.go b/gemini/serve.go
index c148558..cd51370 100644
--- a/gemini/serve.go
+++ b/gemini/serve.go
@@ -8,10 +8,12 @@ import (
"sync"
"tildegit.org/tjp/gus"
+ "tildegit.org/tjp/gus/logging"
)
type server struct {
ctx context.Context
+ errorLog logging.Logger
network string
address string
cancel context.CancelFunc
@@ -23,6 +25,7 @@ type server struct {
// NewServer builds a gemini server.
func NewServer(
ctx context.Context,
+ errorLog logging.Logger,
tlsConfig *tls.Config,
network string,
address string,
@@ -37,6 +40,7 @@ func NewServer(
s := &server{
ctx: ctx,
+ errorLog: errorLog,
network: addr.Network(),
address: addr.String(),
wg: &sync.WaitGroup{},
@@ -69,7 +73,10 @@ func (s *server) Serve() error {
if err != nil {
if s.Closed() {
err = nil
+ } else {
+ s.errorLog.Log("msg", "accept_error", "error", err)
}
+
return err
}