carlos / platform Public

edge: purge.go/purge_listen_windows.go — two stale comments

ListenPurge's doc claimed ListenControl-with-only-the-purge-verb, but
ListenControl only mounts /purge when cache is non-nil — so
ListenPurge(path, host, nil) serves nothing at all, not "the purge
verb". Say so.

purge_listen_windows.go's prose was updated for the control-socket
generalisation in e9f41e1, but the actual error string it returns
still said "purge listeners" — the pre-generalisation name. Match the
comment around it.
Paul Campbell pushed by paul@keymail.dev 589362c3b047bff5cb367d22ee8a7270aebd04a2 parent 68dbd51
2 files changed, +7 −4
  • internal/edge/purge.go +6 −3
  • internal/edge/purge_listen_windows.go +1 −1
diff --git a/internal/edge/purge.go b/internal/edge/purge.go
index 0b883bd06..a36b3a568 100644
--- a/internal/edge/purge.go
+++ b/internal/edge/purge.go
@@ -136,9 +136,12 @@ func ListenControl(socketPath, host string, cache *Cache, mount func(*http.Serve
return p, nil
}
-// ListenPurge is ListenControl with nothing but the purge verb — the shape
-// this had before the channel generalized, kept for callers that only want
-// that one verb.
+// ListenPurge is ListenControl with mount left nil — the shape this had
+// before the channel generalized, kept for callers that only want the
+// purge verb and none of the scheduled-work ones. It is not a promise that
+// /purge itself is registered: ListenControl only mounts it when cache is
+// non-nil, so ListenPurge(socketPath, host, nil) serves nothing at all,
+// same as ListenControl would.
func ListenPurge(socketPath, host string, cache *Cache) (*PurgeListener, error) {
return ListenControl(socketPath, host, cache, nil)
}
diff --git a/internal/edge/purge_listen_windows.go b/internal/edge/purge_listen_windows.go
index cd213e987..c7946c6b1 100644
--- a/internal/edge/purge_listen_windows.go
+++ b/internal/edge/purge_listen_windows.go
@@ -20,5 +20,5 @@ import (
// control listener": the instance runs without its control verbs and
// CARLOS_CONTROL_SOCKET is stripped from its environment.
func secureUnixListen(socketPath string) (net.Listener, error) {
- return nil, errors.New("purge listeners need a unix socket with owner-only permissions; not supported on windows")
+ return nil, errors.New("control listeners need a unix socket with owner-only permissions; not supported on windows")
}