Fix GSO batch size
This commit is contained in:
parent
689e60891c
commit
8bfb64cf04
1 changed files with 3 additions and 1 deletions
|
|
@ -136,11 +136,13 @@ func (t *NativeTun) BatchSize() int {
|
||||||
if !t.gsoEnabled {
|
if !t.gsoEnabled {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
/* // Not works on some devices: https://github.com/SagerNet/sing-box/issues/1605
|
||||||
batchSize := int(gsoMaxSize/t.options.MTU) * 2
|
batchSize := int(gsoMaxSize/t.options.MTU) * 2
|
||||||
if batchSize > idealBatchSize {
|
if batchSize > idealBatchSize {
|
||||||
batchSize = idealBatchSize
|
batchSize = idealBatchSize
|
||||||
}
|
}
|
||||||
return batchSize
|
return batchSize*/
|
||||||
|
return idealBatchSize
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *NativeTun) BatchRead(buffers [][]byte, offset int, readN []int) (n int, err error) {
|
func (t *NativeTun) BatchRead(buffers [][]byte, offset int, readN []int) (n int, err error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue