mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-11 02:36:17 +00:00
cmd/discosrv: Accept host names in announced addresses
GitHub-Pull-Request: https://github.com/syncthing/discosrv/pull/48
This commit is contained in:
parent
ff0cd413e6
commit
b1205db7ac
@ -329,10 +329,12 @@ func (s *querysrv) handleAnnounce(ctx context.Context, remote net.IP, deviceID p
|
|||||||
}
|
}
|
||||||
|
|
||||||
ip := net.ParseIP(host)
|
ip := net.ParseIP(host)
|
||||||
if len(ip) == 0 || ip.IsUnspecified() {
|
if host == "" || ip.IsUnspecified() {
|
||||||
uri.Host = net.JoinHostPort(remote.String(), port)
|
host = remote.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uri.Host = net.JoinHostPort(host, port)
|
||||||
|
|
||||||
if err := s.updateAddress(ctx, tx, deviceID, uri.String()); err != nil {
|
if err := s.updateAddress(ctx, tx, deviceID, uri.String()); err != nil {
|
||||||
internalErr = err
|
internalErr = err
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user