mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-06-01 00:00:02 +08:00
Invalidate sockets instead of setting flow as nil
This commit is contained in:
@@ -319,7 +319,7 @@
|
|||||||
void (^completionHandler)(id<OpenVPNAdapterPacketFlow> _Nullable) = ^(id<OpenVPNAdapterPacketFlow> flow) {
|
void (^completionHandler)(id<OpenVPNAdapterPacketFlow> _Nullable) = ^(id<OpenVPNAdapterPacketFlow> flow) {
|
||||||
__strong typeof(self) self = weakSelf;
|
__strong typeof(self) self = weakSelf;
|
||||||
|
|
||||||
if (flow) {
|
if (flow && (self.packetFlowBridge == nil || self.packetFlowBridge != flow)) {
|
||||||
self.packetFlowBridge = [[OpenVPNPacketFlowBridge alloc] initWithPacketFlow:flow];
|
self.packetFlowBridge = [[OpenVPNPacketFlowBridge alloc] initWithPacketFlow:flow];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,7 +403,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)resetTun {
|
- (void)resetTun {
|
||||||
_packetFlowBridge = nil;
|
[_packetFlowBridge invalidateSocketsIfNeeded];
|
||||||
|
|
||||||
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user