X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fupdate-test.c;h=6b92900e5b4b94bd001911d13ba71dfed64a2269;hb=c7ecad8fa467b8be2b34064020e2c541c480645e;hp=bd42c757a26b2b69f3b0a41802a8596d82eca4bc;hpb=11fdf8612c684b0faf85781ef1b2766bf6ea1f0b;p=catta diff --git a/avahi-core/update-test.c b/avahi-core/update-test.c index bd42c75..6b92900 100644 --- a/avahi-core/update-test.c +++ b/avahi-core/update-test.c @@ -24,6 +24,7 @@ #endif #include +#include #include #include @@ -39,7 +40,7 @@ static AvahiSEntryGroup *group = NULL; -static void server_callback(AvahiServer *s, AvahiServerState state, void* userdata) { +static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("server state: %i", state); @@ -56,15 +57,17 @@ static void server_callback(AvahiServer *s, AvahiServerState state, void* userda } } -static void modify_txt_callback(AvahiTimeout *e, void *userdata) { +static void modify_txt_callback(AVAHI_GCC_UNUSED AvahiTimeout *e, void *userdata) { int ret; AvahiServer *s = userdata; + avahi_log_debug("modifying"); + ret = avahi_server_update_service_txt(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "foo", "_http._tcp", NULL, "test2", NULL); assert(ret == AVAHI_OK); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiSimplePoll *simple_poll; const AvahiPoll *poll_api; AvahiServer *server; @@ -83,7 +86,8 @@ int main(int argc, char *argv[]) { assert(server); avahi_server_config_free(&config); - poll_api->timeout_new(poll_api, avahi_elapse_time(&tv, 1000*20, 0), modify_txt_callback, server); + poll_api->timeout_new(poll_api, avahi_elapse_time(&tv, 1000*10, 0), modify_txt_callback, server); avahi_simple_poll_loop(simple_poll); + return 0; }