lib/avahi/Client: is if with initializer
This commit is contained in:
parent
a39473a912
commit
f85629afa6
@ -43,8 +43,6 @@ Client::Close() noexcept
|
|||||||
void
|
void
|
||||||
Client::ClientCallback(AvahiClient *c, AvahiClientState state) noexcept
|
Client::ClientCallback(AvahiClient *c, AvahiClientState state) noexcept
|
||||||
{
|
{
|
||||||
int error;
|
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case AVAHI_CLIENT_S_RUNNING:
|
case AVAHI_CLIENT_S_RUNNING:
|
||||||
for (auto *l : listeners)
|
for (auto *l : listeners)
|
||||||
@ -53,8 +51,8 @@ Client::ClientCallback(AvahiClient *c, AvahiClientState state) noexcept
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AVAHI_CLIENT_FAILURE:
|
case AVAHI_CLIENT_FAILURE:
|
||||||
error = avahi_client_errno(c);
|
if (int error = avahi_client_errno(c);
|
||||||
if (error == AVAHI_ERR_DISCONNECTED) {
|
error == AVAHI_ERR_DISCONNECTED) {
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
reconnect_timer.Schedule(std::chrono::seconds(10));
|
reconnect_timer.Schedule(std::chrono::seconds(10));
|
||||||
|
Loading…
Reference in New Issue
Block a user