lib/avahi/Publisher: move code to RegisterServices(AvahiEntryGroup)
This commit is contained in:
parent
1b241fc97a
commit
4a14248004
@ -83,7 +83,7 @@ try {
|
||||
}
|
||||
|
||||
/* And recreate the services */
|
||||
RegisterServices(avahi_entry_group_get_client(g));
|
||||
RegisterServices(*g);
|
||||
break;
|
||||
|
||||
case AVAHI_ENTRY_GROUP_FAILURE:
|
||||
@ -129,6 +129,16 @@ AddServices(AvahiEntryGroup &group,
|
||||
AddService(group, i, name);
|
||||
}
|
||||
|
||||
void
|
||||
Publisher::RegisterServices(AvahiEntryGroup &g)
|
||||
{
|
||||
AddServices(g, services, name.c_str());
|
||||
|
||||
if (int error = avahi_entry_group_commit(&g);
|
||||
error != AVAHI_OK)
|
||||
throw MakeError(error, "Failed to commit Avahi service group");
|
||||
}
|
||||
|
||||
void
|
||||
Publisher::RegisterServices(AvahiClient *c)
|
||||
{
|
||||
@ -140,11 +150,7 @@ Publisher::RegisterServices(AvahiClient *c)
|
||||
throw MakeError(*c, "Failed to create Avahi service group");
|
||||
}
|
||||
|
||||
AddServices(*group, services, name.c_str());
|
||||
|
||||
if (int error = avahi_entry_group_commit(group.get());
|
||||
error != AVAHI_OK)
|
||||
throw MakeError(error, "Failed to commit Avahi service group");
|
||||
RegisterServices(*group);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -68,6 +68,7 @@ private:
|
||||
AvahiEntryGroupState state,
|
||||
void *userdata) noexcept;
|
||||
|
||||
void RegisterServices(AvahiEntryGroup &g);
|
||||
void RegisterServices(AvahiClient *c);
|
||||
|
||||
/* virtual methods from class AvahiConnectionListener */
|
||||
|
Loading…
Reference in New Issue
Block a user