summaryrefslogtreecommitdiffstats
path: root/avahi-compat-libdns_sd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-10-15 23:30:48 +0000
committerLennart Poettering <lennart@poettering.net>2005-10-15 23:30:48 +0000
commitfee238b3a20c8fbb34af6b08995df2265131bee6 (patch)
tree07df8bea9150b4bcddc046aad878812fb26cba93 /avahi-compat-libdns_sd
parenta3e970169340cc5d846b7409c72486f4f1584e81 (diff)
Minor cleanups
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@784 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-compat-libdns_sd')
-rw-r--r--avahi-compat-libdns_sd/compat.c8
-rw-r--r--avahi-compat-libdns_sd/funcs.txt9
2 files changed, 12 insertions, 5 deletions
diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c
index 9b7ff8b..e56168b 100644
--- a/avahi-compat-libdns_sd/compat.c
+++ b/avahi-compat-libdns_sd/compat.c
@@ -845,11 +845,10 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us
return;
switch (state) {
- case AVAHI_CLIENT_DISCONNECTED: {
+ case AVAHI_CLIENT_DISCONNECTED:
reg_report_error(sdref, kDNSServiceErr_NoError);
break;
- }
case AVAHI_CLIENT_S_RUNNING: {
int ret;
@@ -859,6 +858,7 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us
/* If the service name is taken from the host name, copy that */
avahi_free(sdref->service_name_chosen);
+ sdref->service_name_chosen = NULL;
if (!(n = avahi_client_get_host_name(sdref->client))) {
reg_report_error(sdref, map_error(avahi_client_errno(sdref->client)));
@@ -982,7 +982,9 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
sdref->service_host = host ? avahi_normalize_name_strdup(host) : NULL;
sdref->service_interface = interface == kDNSServiceInterfaceIndexAny ? AVAHI_IF_UNSPEC : (AvahiIfIndex) interface;
sdref->service_port = ntohs(port);
- sdref->service_txt = txtRecord ? avahi_string_list_parse(txtRecord, txtLen) : NULL;
+ sdref->service_txt = txtRecord && txtLen > 0 ? avahi_string_list_parse(txtRecord, txtLen) : NULL;
+
+ /* Some OOM checking would be cool here */
ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
diff --git a/avahi-compat-libdns_sd/funcs.txt b/avahi-compat-libdns_sd/funcs.txt
index 8bafc1a..a584b4e 100644
--- a/avahi-compat-libdns_sd/funcs.txt
+++ b/avahi-compat-libdns_sd/funcs.txt
@@ -1,4 +1,4 @@
-Supported:
+-- Supported --
DNSServiceRefSockFD
DNSServiceProcessResult
@@ -20,7 +20,7 @@ TXTRecordGetValuePtr
TXTRecordGetCount
TXTRecordGetItemAtIndex
-Unsupported:
+-- Unsupported but Relevant --
DNSServiceRegisterRecord
DNSServiceQueryRecord
@@ -29,4 +29,9 @@ DNSServiceCreateConnection
DNSServiceAddRecord
DNSServiceUpdateRecord
DNSServiceRemoveRecord
+
+-- Unsupported and Irrelevant --
+
DNSServiceSetDefaultDomainForUser
+
+$Id$