Support dual-stacked peers

This commit is contained in:
Justin Li
2014-07-23 13:15:04 -04:00
parent 14843b9e89
commit b227fc1fcd
6 changed files with 91 additions and 60 deletions
+3 -2
View File
@@ -35,7 +35,7 @@ func NewAnnounce(cfg *config.Config, r *http.Request, p httprouter.Params) (*mod
return nil, models.ErrMalformedRequest
}
ip, err := q.RequestedIP(r, cfg.AllowIPSpoofing)
ipv4, ipv6, err := q.RequestedIP(r, cfg.AllowIPSpoofing)
if err != nil {
return nil, models.ErrMalformedRequest
}
@@ -65,7 +65,8 @@ func NewAnnounce(cfg *config.Config, r *http.Request, p httprouter.Params) (*mod
Compact: compact,
Downloaded: downloaded,
Event: event,
IP: ip,
IPv4: ipv4,
IPv6: ipv6,
Infohash: infohash,
Left: left,
NumWant: numWant,