tcpproxy: increase buffer size to 16K (#9548)

This commit is contained in:
Ismayil Mirzali 2023-01-27 17:12:27 +02:00 committed by GitHub
parent ea629a175e
commit 5628f765fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,11 +59,12 @@ func (p *TCPProxy) Get(host string) *TCPServer {
// and open a connection to the passthrough server. // and open a connection to the passthrough server.
func (p *TCPProxy) Handle(conn net.Conn) { func (p *TCPProxy) Handle(conn net.Conn) {
defer conn.Close() defer conn.Close()
data := make([]byte, 4096) // See: https://www.ibm.com/docs/en/ztpf/1.1.0.15?topic=sessions-ssl-record-format
data := make([]byte, 16384)
length, err := conn.Read(data) length, err := conn.Read(data)
if err != nil { if err != nil {
klog.V(4).ErrorS(err, "Error reading the first 4k of the connection") klog.V(4).ErrorS(err, "Error reading data from the connection")
return return
} }