Skip to content

Commit

Permalink
Fixed addition/removal of devices during discovery (thanks @leolobato).
Browse files Browse the repository at this point in the history
  • Loading branch information
schamar committed Nov 10, 2017
1 parent 7b3f2e7 commit eb1e3ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Binary file not shown.
16 changes: 8 additions & 8 deletions SMBClient/SMBDiscovery.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,27 @@ - (void)stopDiscovery {
}

static void _on_entry_added(void *p_opaque, netbios_ns_entry *entry) {
if (_addedHandler) {
dispatch_async(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_main_queue(), ^{
if (_addedHandler) {
SMBDevice *device = _device(entry);

if (_typeMask & device.type) {
_addedHandler(_device(entry));
}
});
}
}
});
}

static void _on_entry_removed(void *p_opaque, netbios_ns_entry *entry) {
if (_removedHandler) {
dispatch_async(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_main_queue(), ^{
if (_removedHandler) {
SMBDevice *device = _device(entry);

if (_typeMask & device.type) {
_removedHandler(_device(entry));
}
});
}
}
});
}

@end

0 comments on commit eb1e3ee

Please sign in to comment.