Rename L_REND to L_MDNS

This commit is contained in:
Julien BLACHE 2009-05-08 17:53:39 +02:00
parent d384f3c395
commit 7b3b538ea6
2 changed files with 24 additions and 25 deletions

View File

@ -16,7 +16,6 @@
#define L_XCODE 10 #define L_XCODE 10
/* Will go away */ /* Will go away */
#define L_REND L_MDNS
#define L_LOCK 11 #define L_LOCK 11
#define N_LOGDOMAINS 12 #define N_LOGDOMAINS 12

View File

@ -322,23 +322,23 @@ entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_U
switch (state) switch (state)
{ {
case AVAHI_ENTRY_GROUP_ESTABLISHED: case AVAHI_ENTRY_GROUP_ESTABLISHED:
DPRINTF(E_DBG, L_REND, "Successfully added mDNS services\n"); DPRINTF(E_DBG, L_MDNS, "Successfully added mDNS services\n");
break; break;
case AVAHI_ENTRY_GROUP_COLLISION: case AVAHI_ENTRY_GROUP_COLLISION:
DPRINTF(E_DBG, L_REND, "Group collision\n"); DPRINTF(E_DBG, L_MDNS, "Group collision\n");
break; break;
case AVAHI_ENTRY_GROUP_FAILURE: case AVAHI_ENTRY_GROUP_FAILURE:
DPRINTF(E_DBG, L_REND, "Group failure\n"); DPRINTF(E_DBG, L_MDNS, "Group failure\n");
break; break;
case AVAHI_ENTRY_GROUP_UNCOMMITED: case AVAHI_ENTRY_GROUP_UNCOMMITED:
DPRINTF(E_DBG, L_REND, "Group uncommitted\n"); DPRINTF(E_DBG, L_MDNS, "Group uncommitted\n");
break; break;
case AVAHI_ENTRY_GROUP_REGISTERING: case AVAHI_ENTRY_GROUP_REGISTERING:
DPRINTF(E_DBG, L_REND, "Group registering\n"); DPRINTF(E_DBG, L_MDNS, "Group registering\n");
break; break;
} }
} }
@ -349,11 +349,11 @@ _create_services(void)
struct mdns_group_entry *pentry; struct mdns_group_entry *pentry;
int ret; int ret;
DPRINTF(E_DBG, L_REND, "Creating service group\n"); DPRINTF(E_DBG, L_MDNS, "Creating service group\n");
if (!group_entries) if (!group_entries)
{ {
DPRINTF(E_DBG, L_REND, "No entries yet... skipping service create\n"); DPRINTF(E_DBG, L_MDNS, "No entries yet... skipping service create\n");
return; return;
} }
@ -363,7 +363,7 @@ _create_services(void)
mdns_group = avahi_entry_group_new(mdns_client, entry_group_callback, NULL); mdns_group = avahi_entry_group_new(mdns_client, entry_group_callback, NULL);
if (!mdns_group) if (!mdns_group)
{ {
DPRINTF(E_WARN, L_REND, "Could not create Avahi EntryGroup: %s\n", DPRINTF(E_WARN, L_MDNS, "Could not create Avahi EntryGroup: %s\n",
avahi_strerror(avahi_client_errno(mdns_client))); avahi_strerror(avahi_client_errno(mdns_client)));
return; return;
@ -373,14 +373,14 @@ _create_services(void)
pentry = group_entries; pentry = group_entries;
while (pentry) while (pentry)
{ {
DPRINTF(E_DBG, L_REND, "Re-registering %s/%s\n", pentry->name, pentry->type); DPRINTF(E_DBG, L_MDNS, "Re-registering %s/%s\n", pentry->name, pentry->type);
ret = avahi_entry_group_add_service_strlst(mdns_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, ret = avahi_entry_group_add_service_strlst(mdns_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0,
avahi_strdup(pentry->name), avahi_strdup(pentry->type), avahi_strdup(pentry->name), avahi_strdup(pentry->type),
NULL, NULL, pentry->port, pentry->txt); NULL, NULL, pentry->port, pentry->txt);
if (ret < 0) if (ret < 0)
{ {
DPRINTF(E_WARN, L_REND, "Could not add mDNS services: %s\n", avahi_strerror(ret)); DPRINTF(E_WARN, L_MDNS, "Could not add mDNS services: %s\n", avahi_strerror(ret));
return; return;
} }
@ -391,7 +391,7 @@ _create_services(void)
ret = avahi_entry_group_commit(mdns_group); ret = avahi_entry_group_commit(mdns_group);
if (ret < 0) if (ret < 0)
{ {
DPRINTF(E_WARN, L_REND, "Could not commit mDNS services: %s\n", DPRINTF(E_WARN, L_MDNS, "Could not commit mDNS services: %s\n",
avahi_strerror(avahi_client_errno(mdns_client))); avahi_strerror(avahi_client_errno(mdns_client)));
} }
} }
@ -404,24 +404,24 @@ client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void *
switch (state) switch (state)
{ {
case AVAHI_CLIENT_S_RUNNING: case AVAHI_CLIENT_S_RUNNING:
DPRINTF(E_LOG, L_REND, "Avahi state change: Client running\n"); DPRINTF(E_LOG, L_MDNS, "Avahi state change: Client running\n");
if (!mdns_group) if (!mdns_group)
_create_services(); _create_services();
break; break;
case AVAHI_CLIENT_S_COLLISION: case AVAHI_CLIENT_S_COLLISION:
DPRINTF(E_LOG, L_REND, "Avahi state change: Client collision\n"); DPRINTF(E_LOG, L_MDNS, "Avahi state change: Client collision\n");
if(mdns_group) if(mdns_group)
avahi_entry_group_reset(mdns_group); avahi_entry_group_reset(mdns_group);
break; break;
case AVAHI_CLIENT_FAILURE: case AVAHI_CLIENT_FAILURE:
DPRINTF(E_LOG, L_REND, "Avahi state change: Client failure\n"); DPRINTF(E_LOG, L_MDNS, "Avahi state change: Client failure\n");
error = avahi_client_errno(c); error = avahi_client_errno(c);
if (error == AVAHI_ERR_DISCONNECTED) if (error == AVAHI_ERR_DISCONNECTED)
{ {
DPRINTF(E_LOG, L_REND, "Avahi Server disconnected, reconnecting\n"); DPRINTF(E_LOG, L_MDNS, "Avahi Server disconnected, reconnecting\n");
avahi_client_free(mdns_client); avahi_client_free(mdns_client);
mdns_group = NULL; mdns_group = NULL;
@ -430,24 +430,24 @@ client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void *
client_callback, NULL, &error); client_callback, NULL, &error);
if (!mdns_client) if (!mdns_client)
{ {
DPRINTF(E_LOG, L_REND, "Failed to create new Avahi client: %s\n", DPRINTF(E_LOG, L_MDNS, "Failed to create new Avahi client: %s\n",
avahi_strerror(error)); avahi_strerror(error));
} }
} }
else else
{ {
DPRINTF(E_LOG, L_REND, "Avahi client failure: %s\n", avahi_strerror(error)); DPRINTF(E_LOG, L_MDNS, "Avahi client failure: %s\n", avahi_strerror(error));
} }
break; break;
case AVAHI_CLIENT_S_REGISTERING: case AVAHI_CLIENT_S_REGISTERING:
DPRINTF(E_LOG, L_REND, "Avahi state change: Client registering\n"); DPRINTF(E_LOG, L_MDNS, "Avahi state change: Client registering\n");
if (mdns_group) if (mdns_group)
avahi_entry_group_reset(mdns_group); avahi_entry_group_reset(mdns_group);
break; break;
case AVAHI_CLIENT_CONNECTING: case AVAHI_CLIENT_CONNECTING:
DPRINTF(E_LOG, L_REND, "Avahi state change: Client connecting\n"); DPRINTF(E_LOG, L_MDNS, "Avahi state change: Client connecting\n");
break; break;
} }
} }
@ -460,7 +460,7 @@ mdns_init(void)
{ {
int error; int error;
DPRINTF(E_DBG, L_REND, "Initializing Avahi mDNS\n"); DPRINTF(E_DBG, L_MDNS, "Initializing Avahi mDNS\n");
all_w = NULL; all_w = NULL;
all_t = NULL; all_t = NULL;
@ -470,7 +470,7 @@ mdns_init(void)
client_callback, NULL, &error); client_callback, NULL, &error);
if (!mdns_client) if (!mdns_client)
{ {
DPRINTF(E_WARN, L_REND, "mdns_init: Could not create Avahi client: %s\n", DPRINTF(E_WARN, L_MDNS, "mdns_init: Could not create Avahi client: %s\n",
avahi_strerror(avahi_client_errno(mdns_client))); avahi_strerror(avahi_client_errno(mdns_client)));
return -1; return -1;
@ -514,7 +514,7 @@ mdns_register(char *name, char *type, int port, char **txt)
AvahiStringList *txt_sl; AvahiStringList *txt_sl;
int i; int i;
DPRINTF(E_DBG, L_REND, "Adding mDNS service %s/%s\n", name, type); DPRINTF(E_DBG, L_MDNS, "Adding mDNS service %s/%s\n", name, type);
ge = (struct mdns_group_entry *)malloc(sizeof(struct mdns_group_entry)); ge = (struct mdns_group_entry *)malloc(sizeof(struct mdns_group_entry));
if (!ge) if (!ge)
@ -529,7 +529,7 @@ mdns_register(char *name, char *type, int port, char **txt)
{ {
txt_sl = avahi_string_list_add(txt_sl, txt[i]); txt_sl = avahi_string_list_add(txt_sl, txt[i]);
DPRINTF(E_DBG, L_REND, "Added key %s\n", txt[i]); DPRINTF(E_DBG, L_MDNS, "Added key %s\n", txt[i]);
} }
ge->txt = txt_sl; ge->txt = txt_sl;
@ -543,7 +543,7 @@ mdns_register(char *name, char *type, int port, char **txt)
avahi_entry_group_reset(mdns_group); avahi_entry_group_reset(mdns_group);
} }
DPRINTF(E_DBG, L_REND, "Creating service group\n"); DPRINTF(E_DBG, L_MDNS, "Creating service group\n");
_create_services(); _create_services();
return 0; return 0;