diff --git a/core/tun.go b/core/tun.go index 5215bac..e266e74 100644 --- a/core/tun.go +++ b/core/tun.go @@ -23,15 +23,12 @@ type FdMap struct { } func (cm *FdMap) Store(key int) { - cm.m.Store(key, nil) + cm.m.Store(key, struct{}{}) } func (cm *FdMap) Load(key int) bool { _, ok := cm.m.Load(key) - if !ok { - return false - } - return true + return ok } var fdMap FdMap @@ -96,23 +93,23 @@ func init() { } return conn.Control(func(fd uintptr) { fdInt := int(fd) - timeout := time.After(100 * time.Millisecond) + //timeout := time.After(100 * time.Millisecond) if tun != nil { tun.MarkSocket(fdInt) + time.Sleep(100 * time.Millisecond) } - for { - select { - case <-timeout: - return - default: - exists := fdMap.Load(fdInt) - if exists { - return - } - time.Sleep(10 * time.Millisecond) - } - } - + //for { + // select { + // case <-timeout: + // return + // default: + // exists := fdMap.Load(fdInt) + // if exists { + // return + // } + // time.Sleep(20 * time.Millisecond) + // } + //} }) } } diff --git a/lib/widgets/clash_message_container.dart b/lib/widgets/clash_message_container.dart index 6719457..3f83694 100644 --- a/lib/widgets/clash_message_container.dart +++ b/lib/widgets/clash_message_container.dart @@ -75,10 +75,4 @@ class _ClashMessageContainerState extends State globalState.appController.appState.addRequest(connection); super.onRequest(connection); } - - @override - void onRun(String runTime) async { - // proxy?.updateStartTime(); - super.onRun(runTime); - } } diff --git a/pubspec.yaml b/pubspec.yaml index 71a4ee0..5cae540 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: fl_clash description: A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free. publish_to: 'none' -version: 0.8.33+202407011 +version: 0.8.33+202407012 environment: sdk: '>=3.1.0 <4.0.0'