Skip site navigation (1) Skip section navigation (2)

Use dns_sd.h for Bonjour

From: Chris Campbell <chris(at)bignerdranch(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Use dns_sd.h for Bonjour
Date: 2006-10-07 23:13:26
Message-ID: 437715E7-EAA7-468F-AAD0-12F30D63CA4F@bignerdranch.com (view raw or flat)
Thread:
Lists: pgsql-patches
Re: Darwin stuff is getting deprecated

     http://archives.postgresql.org/pgsql-hackers/2006-09/msg02238.php

Mac OS X versions 10.3 and later support a new, non-Mach API for  
registering Bonjour services. I believe this API is also available on  
other platforms. I see /usr/lib/libdns_sd.so.1 on my Fedora Core 5  
system, but I can't find a header for it.

New API (<dns_sd.h>):

     http://developer.apple.com/documentation/Networking/Conceptual/ 
dns_discovery_api/index.html

Deprecated API (currently used by PostgreSQL):

     http://developer.apple.com/documentation/Networking/Conceptual/ 
dns_discovery_mach/index.html

The attached patch uses the new API.

(1) This requires Mac OS X 10.3 and later. Do we currently support  
PostgreSQL on older versions of Mac OS X? Is it acceptable to break  
Bonjour support on those systems?

(2) On non-Mac OS X platforms, <dns_sd.h> may require an additional  
library to be linked in for the postmaster.

(3) The current behavior for the bonjour_name GUC is that if  
PostgreSQL was compiled using --with-bonjour, Bonjour support is  
always enabled, and the default service name (the computer name) is  
used if bonjour_name is the empty string (""). This patch retains  
this behavior for choosing to use the default service name, which  
requires that NULL be passed in to DNSServiceRegister() as the  
service name (rather than "" like the old API).

(4) I patched configure.in, but not configure. Is that right?

Thanks!

- Chris


Attachment: dns_sd.patch
Description: application/octet-stream (3.1 KB)

pgsql-patches by date

Next:From: Chris CampbellDate: 2006-10-08 01:04:26
Subject: Use non-deprecated APIs for dynloader/darwin.c
Previous:From: Peter EisentrautDate: 2006-10-07 07:01:58
Subject: Re: ISO week dates

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group