]> git.meshlink.io Git - catta/commitdiff
* Gracefully handle some conditions in libdns_sd that Bonjour handles
authorTrent Lloyd <lathiat@bur.st>
Thu, 28 Dec 2006 15:45:29 +0000 (15:45 +0000)
committerTrent Lloyd <lathiat@bur.st>
Thu, 28 Dec 2006 15:45:29 +0000 (15:45 +0000)
   (Closes #64)

git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1345 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-compat-libdns_sd/compat.c

index e6b60421fb35ea12e759d958bcc35da986fce3be..9dc22817632034a8b3864c7907b66dbb914c7ebc 100644 (file)
@@ -610,10 +610,13 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse(
     struct type_info type_info;
     
     AVAHI_WARN_LINKAGE;
-    
-    assert(ret_sdref);
+
+    if (!ret_sdref)
+        return kDNSServiceErr_BadParam;
+
+    *ret_sdref = NULL;
+
     assert(regtype);
-    assert(callback);
 
     if (interface == kDNSServiceInterfaceIndexLocalOnly || flags != 0) {
         AVAHI_WARN_UNSUPPORTED;
@@ -1091,8 +1094,14 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
 
     AVAHI_WARN_LINKAGE;
 
-    assert(ret_sdref);
-    assert(regtype);
+    if (!ret_sdref)
+        return kDNSServiceErr_BadParam;
+
+    *ret_sdref = NULL;
+    
+    if (!regtype)
+           return kDNSServiceErr_BadParam;
+       
     assert(txtRecord || txtLen == 0);
 
     if (interface == kDNSServiceInterfaceIndexLocalOnly || flags) {