use separate backend hooks with tighter pledge
Ted Unangst tedu@tedunangst.com
Wed, 27 Nov 2019 15:58:41 -0500
2 files changed,
6 insertions(+),
1 deletions(-)
M
backend.go
→
backend.go
@@ -73,6 +73,8 @@ }
return res.Image, nil } +var backendhooks []func() + func backendServer() { log.Printf("backend server running") shrinker := new(Shrinker)@@ -92,7 +94,7 @@ lis, err := net.Listen("unix", sockname)
if err != nil { log.Panicf("unable to register shrinker: %s", err) } - for _, h := range preservehooks { + for _, h := range backendhooks { h() } srv.Accept(lis)