From 65fb311a97a0d5bc4f02d24616ad9f41a2b16f4a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 11 Jun 2003 06:56:07 +0000 Subject: Add Rendezvous support to postmaster, from Chris Campbell --- src/backend/postmaster/postmaster.c | 29 ++++++++++++++++++++++++++++- src/include/pg_config.h.in | 3 +++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index ef4266be53..5b16d06a99 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.331 2003/05/28 19:36:28 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.332 2003/06/11 06:56:06 momjian Exp $ * * NOTES * @@ -85,6 +85,10 @@ #include #endif +#ifdef USE_RENDEZVOUS +#include +#endif + #include "catalog/pg_database.h" #include "commands/async.h" #include "lib/dllist.h" @@ -366,6 +370,17 @@ checkDataDir(const char *checkdir) } +#ifdef USE_RENDEZVOUS + +/* reg_reply -- empty callback function for DNSServiceRegistrationCreate() */ +static void +reg_reply(DNSServiceRegistrationReplyErrorType errorCode, void *context) +{ + +} + +#endif + int PostmasterMain(int argc, char *argv[]) { @@ -723,6 +738,18 @@ PostmasterMain(int argc, char *argv[]) else elog(LOG, "IPv4 socket created"); } +#endif +#ifdef USE_RENDEZVOUS + if (service_name != NULL) + { + DNSServiceRegistrationCreate(NULL, /* default to hostname */ + "_postgresql._tcp.", + "", + htonl(PostPortNumber), + "", + (DNSServiceRegistrationReply)reg_reply, + NULL); + } #endif } diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index bc6d89ada1..b20cecf194 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -564,6 +564,9 @@ /* Define to 1 to build with PAM support. (--with-pam) */ #undef USE_PAM +/* Define to 1 to build with Rendezvous support. (--with-rendezvous) */ +#undef USE_RENDEZVOUS + /* Define to build with (Open)SSL support. (--with-openssl) */ #undef USE_SSL -- cgit v1.2.1