missing updates #5

Merged
mats merged 77 commits from refactor/http-proxy into main 2025-10-14 23:12:06 +02:00
Showing only changes of commit 67b9a739fe - Show all commits

View File

@@ -144,8 +144,17 @@ func (p *SimpleGrainPool[V]) TakeOwnership(id uint64) {
}
func (p *SimpleGrainPool[V]) AddRemote(host string) (Host, error) {
if host == "" || host == p.hostname || p.IsKnown(host) {
return nil, fmt.Errorf("invalid host")
if host == "" {
return nil, fmt.Errorf("host is empty")
}
if host == p.hostname {
return nil, fmt.Errorf("same host, this should not happen")
}
p.remoteMu.RLock()
existing, found := p.remoteHosts[host]
p.remoteMu.RUnlock()
if found {
return existing, nil
}
remote, err := p.spawnHost(host)