Skip to content

Commit

Permalink
Fix android proxy error
Browse files Browse the repository at this point in the history
  • Loading branch information
chen08209 committed Jul 1, 2024
1 parent acbcec3 commit 6dcb466
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
35 changes: 16 additions & 19 deletions core/tun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
// }
//}
})
}
}
6 changes: 0 additions & 6 deletions lib/widgets/clash_message_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,4 @@ class _ClashMessageContainerState extends State<ClashMessageContainer>
globalState.appController.appState.addRequest(connection);
super.onRequest(connection);
}

@override
void onRun(String runTime) async {
// proxy?.updateStartTime();
super.onRun(runTime);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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'

Expand Down

0 comments on commit 6dcb466

Please sign in to comment.