aboutsummaryrefslogtreecommitdiff
path: root/tracker/messages.go
diff options
context:
space:
mode:
Diffstat (limited to 'tracker/messages.go')
-rw-r--r--tracker/messages.go22
1 files changed, 0 insertions, 22 deletions
diff --git a/tracker/messages.go b/tracker/messages.go
index 76b9232..750774a 100644
--- a/tracker/messages.go
+++ b/tracker/messages.go
@@ -1,9 +1,7 @@
package tracker
import (
- "bytes"
"crypto/sha1"
- "encoding/binary"
"io/ioutil"
"net"
"net/http"
@@ -77,23 +75,3 @@ func (r Request) Get(announce string) (Response, error) {
}
return res, nil
}
-
-func peerAddr(b []byte) ([]*net.TCPAddr, error) {
- n := len(b) / 6
- a := make([]*net.TCPAddr, n)
-
- var port uint16
- for i := 0; i < n; i++ {
- off := i * 6
- buf := bytes.NewReader(b[off+4 : off+6])
- err := binary.Read(buf, binary.BigEndian, &port)
- if err != nil {
- return nil, err
- }
- a[i] = &net.TCPAddr{
- IP: net.IP(b[off : off+4]),
- Port: int(port),
- }
- }
- return a, nil
-}