mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-01 02:30:33 +00:00
NULL
terminate the bytes with unix.ByteSliceToString
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
|||||||
"github.com/up9inc/mizu/logger"
|
"github.com/up9inc/mizu/logger"
|
||||||
"github.com/up9inc/mizu/tap/api"
|
"github.com/up9inc/mizu/tap/api"
|
||||||
orderedmap "github.com/wk8/go-ordered-map"
|
orderedmap "github.com/wk8/go-ordered-map"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -186,10 +187,12 @@ func (p *tlsPoller) pollGolangReadWrite(rd *ringbuf.Reader, emitter api.Emitter,
|
|||||||
|
|
||||||
request := make([]byte, len(b.Data[:]))
|
request := make([]byte, len(b.Data[:]))
|
||||||
copy(request, b.Data[:])
|
copy(request, b.Data[:])
|
||||||
|
request = []byte(unix.ByteSliceToString(request))
|
||||||
connection.ClientReader.send(request)
|
connection.ClientReader.send(request)
|
||||||
} else {
|
} else {
|
||||||
response := make([]byte, len(b.Data[:]))
|
response := make([]byte, len(b.Data[:]))
|
||||||
copy(response, b.Data[:])
|
copy(response, b.Data[:])
|
||||||
|
response = []byte(unix.ByteSliceToString(response))
|
||||||
connection.ServerReader.send(response)
|
connection.ServerReader.send(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user