From eff3908a822d24d8952cc3cd547eeb36f2affa7f Mon Sep 17 00:00:00 2001 From: Mikhail Faraponov <11322032+moredure@users.noreply.github.com> Date: Fri, 25 Mar 2022 02:07:47 +0200 Subject: [PATCH] Move default packet size to constant (#1319) --- infile.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infile.go b/infile.go index 60effdfc2..e6323aea4 100644 --- a/infile.go +++ b/infile.go @@ -93,10 +93,12 @@ func deferredClose(err *error, closer io.Closer) { } } +const defaultPacketSize = 16 * 1024 // 16KB is small enough for disk readahead and large enough for TCP + func (mc *mysqlConn) handleInFileRequest(name string) (err error) { var rdr io.Reader var data []byte - packetSize := 16 * 1024 // 16KB is small enough for disk readahead and large enough for TCP + packetSize := defaultPacketSize if mc.maxWriteSize < packetSize { packetSize = mc.maxWriteSize }