From ddf11a177ee32a73843c9831027a277dff605c28 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 12 Jan 2005 16:38:17 +0000 Subject: [PATCH] =?utf8?q?Increase=20MAXLISTEN=20to=20a=20more=20generous?= =?utf8?q?=20value,=20and=20add=20an=20error=20message=20telling=20when=20?= =?utf8?q?it=20has=20been=20exceeded.=20=20Per=20trouble=20report=20from?= =?utf8?q?=20Jean-G=C3=85rard=20Pailloncy.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/backend/libpq/pqcomm.c | 4 +++- src/backend/postmaster/postmaster.c | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 4ad5bfc7ef..95a70cc74e 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -298,7 +298,9 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber, } if (listen_index >= MaxListen) { - /* Nothing found. */ + ereport(LOG, + (errmsg("could not bind to all requested addresses: MAXLISTEN (%d) exceeded", + MaxListen))); break; } diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 2850ba7bc7..835e72b5f1 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -92,6 +92,7 @@ #include #endif +#include "catalog/pg_control.h" #include "catalog/pg_database.h" #include "commands/async.h" #include "lib/dllist.h" @@ -167,7 +168,7 @@ int ReservedBackends; static const char *progname = NULL; /* The socket(s) we're listening to. */ -#define MAXLISTEN 10 +#define MAXLISTEN 64 static int ListenSocket[MAXLISTEN]; /* @@ -337,8 +338,8 @@ typedef struct #endif char my_exec_path[MAXPGPATH]; char ExtraOptions[MAXPGPATH]; - char lc_collate[MAXPGPATH]; - char lc_ctype[MAXPGPATH]; + char lc_collate[LOCALE_NAME_BUFLEN]; + char lc_ctype[LOCALE_NAME_BUFLEN]; } BackendParameters; static void read_backend_variables(char *id, Port *port); @@ -3682,8 +3683,8 @@ save_backend_variables(BackendParameters *param, Port *port, StrNCpy(param->ExtraOptions, ExtraOptions, MAXPGPATH); - StrNCpy(param->lc_collate, setlocale(LC_COLLATE, NULL), MAXPGPATH); - StrNCpy(param->lc_ctype, setlocale(LC_CTYPE, NULL), MAXPGPATH); + StrNCpy(param->lc_collate, setlocale(LC_COLLATE, NULL), LOCALE_NAME_BUFLEN); + StrNCpy(param->lc_ctype, setlocale(LC_CTYPE, NULL), LOCALE_NAME_BUFLEN); return true; } -- 2.39.5