Add EventTraffic

This commit is contained in:
9seconds
2021-03-22 17:54:46 +03:00
parent 925a02dac3
commit 42160a08fe
18 changed files with 569 additions and 55 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ type Conn struct {
writeBuf []byte
}
func (c *Conn) Read(p []byte) (int, error) {
func (c Conn) Read(p []byte) (int, error) {
n, err := c.Conn.Read(p)
if err != nil {
return n, err // nolint: wrapcheck
@@ -25,7 +25,7 @@ func (c *Conn) Read(p []byte) (int, error) {
return n, nil
}
func (c *Conn) Write(p []byte) (int, error) {
func (c Conn) Write(p []byte) (int, error) {
c.writeBuf = append(c.writeBuf[:0], p...)
c.Encryptor.XORKeyStream(c.writeBuf, c.writeBuf)