mirror of
https://github.com/transmission/transmission
synced 2025-03-09 21:54:09 +00:00
(trunk) back out the avahi patch
This commit is contained in:
parent
9ca9671d3e
commit
6bcce280dc
6 changed files with 0 additions and 74 deletions
|
@ -23,7 +23,6 @@ transmissioncli_LDADD = \
|
|||
$(INTLLIBS) \
|
||||
$(LIBCURL_LIBS) \
|
||||
$(ZLIB_LIBS) \
|
||||
$(AVAHI_LIBS) \
|
||||
$(OPENSSL_LIBS) \
|
||||
$(PTHREAD_LIBS) \
|
||||
-lm
|
||||
|
|
16
configure.ac
16
configure.ac
|
@ -252,21 +252,6 @@ if test "x$build_gtk" = "xyes"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES([AVAHI],
|
||||
[avahi-client],
|
||||
[have_avahi=yes],
|
||||
[have_avahi=no])
|
||||
AC_ARG_ENABLE([avahi],
|
||||
AS_HELP_STRING([--enable-avahi],[enable mDNS advertising for the web interface]),,
|
||||
[enable_avahi=yes])
|
||||
use_avahi=no
|
||||
if test "x$enable_avahi" = "xyes" ; then
|
||||
if test "x$have_avahi" = "xyes"; then
|
||||
use_avahi=yes
|
||||
AC_DEFINE([HAVE_AVAHI], 1)
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([nls],
|
||||
AS_HELP_STRING([--enable-nls],[enable native language support]),,
|
||||
[enable_nls=yes])
|
||||
|
@ -390,7 +375,6 @@ Configuration:
|
|||
... gio support: ${use_gio}
|
||||
... dbus-glib support: ${use_dbus_glib}
|
||||
... libnotify support: ${use_libnotify}
|
||||
... avahi support: ${use_avahi}
|
||||
Build OS X client: ${build_mac}
|
||||
|
||||
"
|
||||
|
|
|
@ -25,7 +25,6 @@ LDADD = \
|
|||
$(INTLLIBS) \
|
||||
$(LIBCURL_LIBS) \
|
||||
$(ZLIB_LIBS) \
|
||||
$(AVAHI_LIBS) \
|
||||
$(OPENSSL_LIBS) \
|
||||
$(PTHREAD_LIBS) -lm
|
||||
|
||||
|
|
|
@ -109,7 +109,6 @@ transmission_LDADD = \
|
|||
$(OPENSSL_LIBS) \
|
||||
$(LIBCURL_LIBS) \
|
||||
$(ZLIB_LIBS) \
|
||||
$(AVAHI_LIBS) \
|
||||
$(PTHREAD_LIBS) -lm
|
||||
|
||||
DESKTOP_IN_FILES=transmission.desktop.in
|
||||
|
|
|
@ -7,7 +7,6 @@ AM_CFLAGS = \
|
|||
$(LIBCURL_CFLAGS) \
|
||||
$(OPENSSL_CFLAGS) \
|
||||
$(PTHREAD_CFLAGS) \
|
||||
$(AVAHI_CFLAGS) \
|
||||
$(ZLIB_CFLAGS)
|
||||
|
||||
noinst_LIBRARIES = libtransmission.a
|
||||
|
@ -129,7 +128,6 @@ apps_ldadd = \
|
|||
$(LIBCURL_LIBS) \
|
||||
$(OPENSSL_LIBS) \
|
||||
$(PTHREAD_LIBS) \
|
||||
$(AVAHI_LIBS) \
|
||||
$(ZLIB_LIBS) \
|
||||
-lm
|
||||
|
||||
|
|
|
@ -24,12 +24,6 @@
|
|||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVAHI
|
||||
#include <avahi-common/simple-watch.h>
|
||||
#include <avahi-client/client.h>
|
||||
#include <avahi-client/publish.h>
|
||||
#endif
|
||||
|
||||
#include <libevent/event.h>
|
||||
#include <libevent/evhttp.h>
|
||||
|
||||
|
@ -68,11 +62,6 @@ struct tr_rpc_server
|
|||
#ifdef HAVE_ZLIB
|
||||
z_stream stream;
|
||||
#endif
|
||||
#ifdef HAVE_AVAHI
|
||||
AvahiSimplePoll *poll;
|
||||
AvahiClient *client;
|
||||
AvahiEntryGroup *group;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define dbgmsg( ... ) \
|
||||
|
@ -530,35 +519,6 @@ handle_request( struct evhttp_request * req,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_AVAHI
|
||||
static void
|
||||
entry_group_callback( AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata )
|
||||
{
|
||||
/* No-op */
|
||||
}
|
||||
|
||||
static void
|
||||
client_callback( AvahiClient *c, AvahiClientState state, void * vserver )
|
||||
{
|
||||
tr_rpc_server * server = vserver;
|
||||
|
||||
if( state != AVAHI_CLIENT_S_RUNNING )
|
||||
{
|
||||
avahi_client_free( server->client );
|
||||
server->client = NULL;
|
||||
avahi_simple_poll_free( server->poll );
|
||||
server->poll = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
server->group = avahi_entry_group_new( c, entry_group_callback, NULL );
|
||||
avahi_entry_group_add_service( server->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
|
||||
0, "Transmission Web Interface", "_http._tcp", NULL, NULL, server->port,
|
||||
"path=/transmission/web", NULL );
|
||||
avahi_entry_group_commit( server->group );
|
||||
}
|
||||
#endif /* HAVE_AVAHI */
|
||||
|
||||
static void
|
||||
startServer( void * vserver )
|
||||
{
|
||||
|
@ -570,10 +530,6 @@ startServer( void * vserver )
|
|||
evhttp_bind_socket( server->httpd, "0.0.0.0", server->port );
|
||||
evhttp_set_gencb( server->httpd, handle_request, server );
|
||||
|
||||
#ifdef HAVE_AVAHI
|
||||
server->poll = avahi_simple_poll_new();
|
||||
server->client = avahi_client_new( avahi_simple_poll_get( server->poll ), 0, client_callback, server, NULL );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -584,15 +540,6 @@ stopServer( tr_rpc_server * server )
|
|||
{
|
||||
evhttp_free( server->httpd );
|
||||
server->httpd = NULL;
|
||||
|
||||
#ifdef HAVE_AVAHI
|
||||
avahi_client_free( server->client );
|
||||
server->client = NULL;
|
||||
avahi_entry_group_free( server->group );
|
||||
server->group = NULL;
|
||||
avahi_simple_poll_free( server->poll );
|
||||
server->poll = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue