mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-31 17:31:32 +00:00
udp: Send the announce interval in seconds
This commit is contained in:
parent
92f3c62456
commit
d3d35b4655
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ package udp
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/chihaya/chihaya/tracker/models"
|
"github.com/chihaya/chihaya/tracker/models"
|
||||||
)
|
)
|
||||||
|
@ -27,7 +28,7 @@ func (w *Writer) WriteError(err error) error {
|
||||||
|
|
||||||
func (w *Writer) WriteAnnounce(res *models.AnnounceResponse) error {
|
func (w *Writer) WriteAnnounce(res *models.AnnounceResponse) error {
|
||||||
w.writeHeader(1)
|
w.writeHeader(1)
|
||||||
binary.Write(w.buf, binary.BigEndian, uint32(res.Interval))
|
binary.Write(w.buf, binary.BigEndian, uint32(res.Interval/time.Second))
|
||||||
binary.Write(w.buf, binary.BigEndian, uint32(res.Incomplete))
|
binary.Write(w.buf, binary.BigEndian, uint32(res.Incomplete))
|
||||||
binary.Write(w.buf, binary.BigEndian, uint32(res.Complete))
|
binary.Write(w.buf, binary.BigEndian, uint32(res.Complete))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue