Skip to content

Commit 0223b8b

Browse files
committed
Merge branch 'main' of https://github.com/SagerNet/sing-tun into meta
2 parents 5d2b354 + cddf605 commit 0223b8b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

monitor_shared.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ func (m *defaultInterfaceMonitor) Start() error {
7272
}
7373

7474
func (m *defaultInterfaceMonitor) delayCheckUpdate() {
75-
if m.checkUpdateTimer != nil {
76-
m.checkUpdateTimer.Stop()
75+
if m.checkUpdateTimer == nil {
76+
m.checkUpdateTimer = time.AfterFunc(time.Second, m.postCheckUpdate)
77+
} else {
78+
m.checkUpdateTimer.Reset(time.Second)
7779
}
78-
m.checkUpdateTimer = time.AfterFunc(time.Second, m.postCheckUpdate)
7980
}
8081

8182
func (m *defaultInterfaceMonitor) postCheckUpdate() {

tun_linux.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,13 @@ func (t *NativeTun) BatchSize() int {
136136
if !t.gsoEnabled {
137137
return 1
138138
}
139+
/* // Not works on some devices: https://github.com/SagerNet/sing-box/issues/1605
139140
batchSize := int(gsoMaxSize/t.options.MTU) * 2
140141
if batchSize > idealBatchSize {
141142
batchSize = idealBatchSize
142143
}
143-
return batchSize
144+
return batchSize*/
145+
return idealBatchSize
144146
}
145147

146148
func (t *NativeTun) BatchRead(buffers [][]byte, offset int, readN []int) (n int, err error) {

0 commit comments

Comments
 (0)