]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/tracker.go
Remove use of relative paths
[rbdr/mobius] / hotline / tracker.go
index d42ff7b52dbd0df0a6423d04db8c7e37f0bb4dfc..0dce9494b393e6776a64c03b21d7d1d97113ea42 100644 (file)
@@ -110,7 +110,7 @@ func GetListing(addr string) ([]ServerRecord, error) {
        if readLen, err = conn.Read(buf); err != nil {
                return nil, err
        }
-       totalRead += readLen  // 1514
+       totalRead += readLen // 1514
 
        var th TrackerHeader
        if err := binary.Read(bytes.NewReader(buf[:6]), binary.BigEndian, &th); err != nil {
@@ -124,6 +124,7 @@ func GetListing(addr string) ([]ServerRecord, error) {
 
        payloadSize := int(binary.BigEndian.Uint16(info.MsgDataSize[:]))
 
+       buf = buf[:readLen]
        if totalRead < payloadSize {
                for {
                        tmpBuf := make([]byte, 4096)
@@ -140,7 +141,6 @@ func GetListing(addr string) ([]ServerRecord, error) {
        totalSrv := int(binary.BigEndian.Uint16(info.SrvCount[:]))
 
        srvBuf := buf[14:totalRead]
-       totalRead += readLen
 
        var servers []ServerRecord