Bugfix proxy request handler

This commit is contained in:
9seconds
2018-07-05 14:59:33 +03:00
parent 4ed877efbc
commit 4210cf014e
3 changed files with 7 additions and 8 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ import (
"bytes"
"crypto/aes"
"encoding/binary"
"fmt"
"hash/crc32"
"io"
"io/ioutil"
@@ -20,7 +21,7 @@ const (
frameRWCMaxMessageLength = 16777216
)
var frameRWCPadding = [4]byte{0x04, 0x00, 0x00, 0x00}
var frameRWCPadding = []byte{0x04, 0x00, 0x00, 0x00}
type FrameRWC struct {
wrappers.BufferedReader
@@ -48,7 +49,7 @@ func (f *FrameRWC) Write(buf []byte) (int, error) {
checksum := crc32.ChecksumIEEE(writeBuf.Bytes())
binary.Write(writeBuf, binary.LittleEndian, checksum)
writeBuf.Write(bytes.Repeat(frameRWCPadding[:], paddingLength/4))
writeBuf.Write(bytes.Repeat(frameRWCPadding, paddingLength/4))
_, err := f.conn.Write(writeBuf.Bytes())
return len(buf), err