Skip to content

Commit

Permalink
Move default packet size to constant (#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
moredure authored Mar 25, 2022
1 parent 90e813f commit eff3908
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion infile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit eff3908

Please sign in to comment.