1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-24 01:29:19 +03:00

Add Rendezvous support to postmaster, from Chris Campbell

This commit is contained in:
Bruce Momjian
2003-06-11 06:56:07 +00:00
parent 1ca0b6d047
commit 65fb311a97
5 changed files with 213 additions and 5 deletions

View File

@@ -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 <getopt.h>
#endif
#ifdef USE_RENDEZVOUS
#include <DNSServiceDiscovery/DNSServiceDiscovery.h>
#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
}