smb: refactor smbc discovery

Authored by sitter on Jun 2 2020, 3:33 PM.

Description

smb: refactor smbc discovery

this now too is based on the discovery design used for WSD and DNSSD.
advantage being that we can then de-duplicate ALL discovieries through
a single code path.

since smbc technically is meant to be used in a dirent while(){} way I am
pulling some tricks here to get this nicer balanced via the event loop.
ideally smbc would be thread safe or at least allow for multiple contexts,
but currently both scenarios aren't working due to upstream bugs :(
so instead of actually blocking while looping each loop cycle is posted
through the event loop. this gives the other discoverers a chance to
get their signal events in and not get stuck waiting for smbc to do its
thing.

specifically also dnssd/wsd are started before smbc (if applicable anyway)
so they get a head start speed things up quite a bit as previously
they had to wait for smbc to do a full listing.

the discoverer discovers a new smbcdiscovery which isn't terribly
interesting but allows for a much more readable loop logic. furthermore
the readdirplus2 ifdefs have been shuffled a bit, also with the goal
of easing readability.

Details

Committed
sitterJun 2 2020, 3:34 PM
Parents
R320:968a5848985c: smb: debug default user that gets tried
Branches
Unknown
Tags
Unknown
References
refs/backups/branch-work/smbcdiscoverer-1591112113