mirror of
https://github.com/therootcompany/telebit.git
synced 2025-12-24 22:38:46 +00:00
- it does not look like the client is limiting the amount of traffic coming in, and it does not look like it is chunking. - need to know the max chunk. - increased to 64K - unpacker code v1 - fixed packer logging.
26 lines
478 B
Go
26 lines
478 B
Go
package packer
|
|
|
|
import "bytes"
|
|
|
|
//packerData -- Contains packer data
|
|
type packerData struct {
|
|
buffer *bytes.Buffer
|
|
DataLen int
|
|
}
|
|
|
|
func newPackerData() (p *packerData) {
|
|
p = new(packerData)
|
|
p.buffer = new(bytes.Buffer)
|
|
return
|
|
}
|
|
|
|
func (p packerData) AppendString(dataString string) (n int, err error) {
|
|
n, err = p.buffer.WriteString(dataString)
|
|
return
|
|
}
|
|
|
|
func (p packerData) AppendBytes(dataBytes []byte) (n int, err error) {
|
|
n, err = p.buffer.Write(dataBytes)
|
|
return
|
|
}
|