Skip to content

Commit 4450dfa

Browse files
4
1 parent b9ed973 commit 4450dfa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

xdcc/xdcc.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,22 @@ type WriteCounter struct {
125125
connection *net.Conn
126126
expectedLength uint64
127127
}
128-
func reverseBytes(input []byte) []byte {
129-
if len(input) == 0 {
130-
return input
131-
}
132-
return append(reverseBytes(input[1:]), input[0])
133-
}
128+
// func reverseBytes(input []byte) []byte {
129+
// if len(input) == 0 {
130+
// return input
131+
// }
132+
// return append(reverseBytes(input[1:]), input[0])
133+
// }
134134
func (wc *WriteCounter) Write(p []byte) (int, error) {
135135
n := len(p)
136136
wc.Total += uint64(n)
137-
buf := bytes.NewBuffer([]byte{})
137+
buf := bytes.NewBuffer(make([]byte,8))
138138

139139
if wc.expectedLength > 0xffffffff {
140140
binary.Write((*wc.connection), binary.BigEndian, buf.Bytes())
141141

142142
}else{
143-
binary.Write(buf, binary.LittleEndian, reverseBytes(buf.Bytes())[0:4])
143+
binary.Write(buf, binary.BigEndian, buf.Bytes()[4:8])
144144

145145
}
146146

0 commit comments

Comments
 (0)