Ignore:
Timestamp:
Apr 5, 2009, 5:34:34 PM (13 years ago)
Author:
charles
Message:

(trunk) back out the avahi patch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r8149 r8152  
    2525#endif
    2626
    27 #ifdef HAVE_AVAHI
    28  #include <avahi-common/simple-watch.h>
    29  #include <avahi-client/client.h>
    30  #include <avahi-client/publish.h>
    31 #endif
    32 
    3327#include <libevent/event.h>
    3428#include <libevent/evhttp.h>
     
    6862#ifdef HAVE_ZLIB
    6963    z_stream           stream;
    70 #endif
    71 #ifdef HAVE_AVAHI
    72     AvahiSimplePoll   *poll;
    73     AvahiClient       *client;
    74     AvahiEntryGroup   *group;
    7564#endif
    7665};
     
    531520}
    532521
    533 #ifdef HAVE_AVAHI
    534 static void
    535 entry_group_callback( AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata )
    536 {
    537         /* No-op */
    538 }
    539 
    540 static void
    541 client_callback( AvahiClient *c, AvahiClientState state, void * vserver )
    542 {
    543         tr_rpc_server * server  = vserver;
    544 
    545         if( state != AVAHI_CLIENT_S_RUNNING )
    546         {
    547                 avahi_client_free( server->client );
    548                 server->client = NULL;
    549                 avahi_simple_poll_free( server->poll );
    550                 server->poll = NULL;
    551                 return;
    552         }
    553 
    554         server->group = avahi_entry_group_new( c, entry_group_callback, NULL );
    555         avahi_entry_group_add_service( server->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
    556                                        0, "Transmission Web Interface", "_http._tcp", NULL, NULL, server->port,
    557                                        "path=/transmission/web", NULL );
    558         avahi_entry_group_commit( server->group );
    559 }
    560 #endif /* HAVE_AVAHI */
    561 
    562522static void
    563523startServer( void * vserver )
     
    571531        evhttp_set_gencb( server->httpd, handle_request, server );
    572532
    573 #ifdef HAVE_AVAHI
    574         server->poll = avahi_simple_poll_new();
    575         server->client = avahi_client_new( avahi_simple_poll_get( server->poll ), 0, client_callback, server, NULL );
    576 #endif
    577533    }
    578534}
     
    585541        evhttp_free( server->httpd );
    586542        server->httpd = NULL;
    587 
    588 #ifdef HAVE_AVAHI
    589         avahi_client_free( server->client );
    590         server->client = NULL;
    591         avahi_entry_group_free( server->group );
    592         server->group = NULL;
    593         avahi_simple_poll_free( server->poll );
    594         server->poll = NULL;
    595 #endif
    596543    }
    597544}
Note: See TracChangeset for help on using the changeset viewer.