mirror of
https://github.com/SinTan1729/privtracker.git
synced 2024-12-26 07:18:37 -06:00
no need to convert bytes to string
This commit is contained in:
parent
1fafa13c95
commit
71f3eead65
1 changed files with 4 additions and 4 deletions
8
main.go
8
main.go
|
@ -36,8 +36,8 @@ type AnnounceResponse struct {
|
||||||
Interval int `bencode:"interval"`
|
Interval int `bencode:"interval"`
|
||||||
Complete int `bencode:"complete"`
|
Complete int `bencode:"complete"`
|
||||||
Incomplete int `bencode:"incomplete"`
|
Incomplete int `bencode:"incomplete"`
|
||||||
Peers string `bencode:"peers"`
|
Peers []byte `bencode:"peers"`
|
||||||
PeersIPv6 string `bencode:"peers_ipv6"`
|
PeersIPv6 []byte `bencode:"peers_ipv6"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func announce(c *gin.Context) {
|
func announce(c *gin.Context) {
|
||||||
|
@ -68,8 +68,8 @@ func announce(c *gin.Context) {
|
||||||
Interval: interval,
|
Interval: interval,
|
||||||
Complete: numSeeders,
|
Complete: numSeeders,
|
||||||
Incomplete: numLeechers,
|
Incomplete: numLeechers,
|
||||||
Peers: string(peersIPv4),
|
Peers: peersIPv4,
|
||||||
PeersIPv6: string(peersIPv6),
|
PeersIPv6: peersIPv6,
|
||||||
}
|
}
|
||||||
if err := bencode.Marshal(c.Writer, resp); err != nil {
|
if err := bencode.Marshal(c.Writer, resp); err != nil {
|
||||||
c.Error(err)
|
c.Error(err)
|
||||||
|
|
Loading…
Reference in a new issue