avahi service publishing cleanup & appveyor

This commit is contained in:
arne 2021-04-13 18:36:48 +02:00
commit 3ec4bf52e1
3 changed files with 5 additions and 9 deletions

View file

@ -9,7 +9,7 @@ environment:
install:
- sh: sudo apt update
- sh: sudo apt install -y build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
- sh: sudo apt install -y build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libavahi-client-dev
- cmd: C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git yasm nasm diffutils make"
before_build:

View file

@ -8,7 +8,6 @@
#include <avahi-common/error.h>
#include <avahi-common/malloc.h>
#include <avahi-common/simple-watch.h>
#include <avahi-common/timeval.h>
#include "publish.h"
#include "nvhttp.h"
@ -105,15 +104,15 @@ void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED vo
void start(std::shared_ptr<safe::signal_t> shutdown_event) {
AvahiClient *client = NULL;
int error;
int avhi_error;
if (!(simple_poll = avahi_simple_poll_new())) {
fprintf(stderr, "Failed to create simple poll object.\n");
BOOST_LOG(error) << "Failed to create simple poll object.";
return;
}
name = avahi_strdup(SERVICE_NAME);
client = avahi_client_new(avahi_simple_poll_get(simple_poll), AvahiClientFlags(0), client_callback, NULL, &error);
client = avahi_client_new(avahi_simple_poll_get(simple_poll), AvahiClientFlags(0), client_callback, NULL, &avhi_error);
if (!client) {
fprintf(stderr, "Failed to create client: %s\n", avahi_strerror(error));
BOOST_LOG(error) << "Failed to create client: " << avahi_strerror(avhi_error);
avahi_simple_poll_free(simple_poll);
return;
}

View file

@ -1,9 +1,6 @@
#ifndef SUNSHINE_PUBLISH_H
#define SUNSHINE_PUBLISH_H
#include <functional>
#include <string>
#include "thread_safe.h"
#define SERVICE_NAME "Sunshine"