mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-26 16:24:54 +00:00
Revert "Compress if it's gzip chunk (probably wrong!)"
This reverts commit 094a7c3da4
.
This commit is contained in:
parent
094a7c3da4
commit
c55f43bbd1
@ -3,7 +3,6 @@ package tlstapper
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"compress/gzip"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"sync"
|
"sync"
|
||||||
@ -162,22 +161,8 @@ func (p *tlsPoller) pollGolangReadWrite(rd *ringbuf.Reader, emitter api.Emitter,
|
|||||||
connection = _connection.(*golangConnection)
|
connection = _connection.(*golangConnection)
|
||||||
}
|
}
|
||||||
|
|
||||||
data := []byte(b.Data[:])
|
|
||||||
|
|
||||||
if b.IsGzipChunk {
|
if b.IsGzipChunk {
|
||||||
// Compress if it's gzip chunk (probably wrong!)
|
|
||||||
connection.Gzipped = true
|
connection.Gzipped = true
|
||||||
var buf bytes.Buffer
|
|
||||||
gz := gzip.NewWriter(&buf)
|
|
||||||
if _, err := gz.Write(data); err != nil {
|
|
||||||
log.Printf("gzip write: %s", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err := gz.Close(); err != nil {
|
|
||||||
log.Printf("gzip close: %s", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
data = buf.Bytes()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.IsRequest {
|
if b.IsRequest {
|
||||||
@ -199,12 +184,12 @@ func (p *tlsPoller) pollGolangReadWrite(rd *ringbuf.Reader, emitter api.Emitter,
|
|||||||
go dissect(p.extension, connection.ClientReader, options)
|
go dissect(p.extension, connection.ClientReader, options)
|
||||||
go dissect(p.extension, connection.ServerReader, options)
|
go dissect(p.extension, connection.ServerReader, options)
|
||||||
|
|
||||||
request := make([]byte, len(data[:b.Len]))
|
request := make([]byte, len(b.Data[:b.Len]))
|
||||||
copy(request, data[:b.Len])
|
copy(request, b.Data[:b.Len])
|
||||||
connection.ClientReader.send(request)
|
connection.ClientReader.send(request)
|
||||||
} else {
|
} else {
|
||||||
response := make([]byte, len(data[:b.Len]))
|
response := make([]byte, len(b.Data[:b.Len]))
|
||||||
copy(response, data[:b.Len])
|
copy(response, b.Data[:b.Len])
|
||||||
connection.ServerReader.send(response)
|
connection.ServerReader.send(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user