mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-24 15:24:17 +00:00
Bring back len
and cap
fields
This commit is contained in:
parent
04935b21aa
commit
f80556d21c
@ -18,6 +18,8 @@ struct golang_read_write {
|
||||
__u32 conn_addr;
|
||||
bool is_request;
|
||||
bool is_gzip_chunk;
|
||||
__u32 len;
|
||||
__u32 cap;
|
||||
__u8 data[BUFFER_SIZE_READ_WRITE];
|
||||
};
|
||||
|
||||
@ -56,6 +58,8 @@ static __always_inline int golang_crypto_tls_write_uprobe(struct pt_regs *ctx) {
|
||||
b->conn_addr = ctx->rsi; // go.itab.*net.TCPConn,net.Conn address
|
||||
b->is_request = true;
|
||||
b->is_gzip_chunk = false;
|
||||
b->len = ctx->rcx;
|
||||
b->cap = ctx->rdi;
|
||||
|
||||
struct socket x = {
|
||||
.pid = s->pid,
|
||||
@ -103,6 +107,8 @@ static __always_inline int golang_crypto_tls_read_uprobe(struct pt_regs *ctx) {
|
||||
b->conn_addr = ctx->rsi; // go.itab.*net.TCPConn,net.Conn address
|
||||
b->is_request = false;
|
||||
b->is_gzip_chunk = false;
|
||||
b->len = ctx->rcx;
|
||||
b->cap = ctx->rcx; // no cap info
|
||||
|
||||
void* stack_addr = (void*)ctx->rsp;
|
||||
__u64 data_p;
|
||||
|
@ -185,12 +185,12 @@ func (p *tlsPoller) pollGolangReadWrite(rd *ringbuf.Reader, emitter api.Emitter,
|
||||
go dissect(p.extension, connection.ClientReader, options)
|
||||
go dissect(p.extension, connection.ServerReader, options)
|
||||
|
||||
request := make([]byte, len(b.Data[:]))
|
||||
copy(request, b.Data[:])
|
||||
request := make([]byte, len(b.Data[:b.Len]))
|
||||
copy(request, b.Data[:b.Len])
|
||||
connection.ClientReader.send(request)
|
||||
} else {
|
||||
response := make([]byte, len(b.Data[:]))
|
||||
copy(response, b.Data[:])
|
||||
response := make([]byte, len(b.Data[:b.Len]))
|
||||
copy(response, b.Data[:b.Len])
|
||||
connection.ServerReader.send(response)
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,10 @@ type tlsTapperGolangReadWrite struct {
|
||||
ConnAddr uint32
|
||||
IsRequest bool
|
||||
IsGzipChunk bool
|
||||
Data [524288]uint8
|
||||
_ [2]byte
|
||||
Len uint32
|
||||
Cap uint32
|
||||
Data [524288]uint8
|
||||
}
|
||||
|
||||
type tlsTapperTlsChunk struct {
|
||||
|
Binary file not shown.
@ -19,8 +19,10 @@ type tlsTapperGolangReadWrite struct {
|
||||
ConnAddr uint32
|
||||
IsRequest bool
|
||||
IsGzipChunk bool
|
||||
Data [524288]uint8
|
||||
_ [2]byte
|
||||
Len uint32
|
||||
Cap uint32
|
||||
Data [524288]uint8
|
||||
}
|
||||
|
||||
type tlsTapperTlsChunk struct {
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user