Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8251e0b

Browse files
committed
Increase MAXLISTEN to a more generous value, and add an error message
telling when it has been exceeded. Per trouble report from Jean-GÅrard Pailloncy.
1 parent 6bb5134 commit 8251e0b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/backend/libpq/pqcomm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
3131
* Portions Copyright (c) 1994, Regents of the University of California
3232
*
33-
* $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.174 2004/12/31 21:59:50 pgsql Exp $
33+
* $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.175 2005/01/12 16:38:17 tgl Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -298,7 +298,9 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
298298
}
299299
if (listen_index >= MaxListen)
300300
{
301-
/* Nothing found. */
301+
ereport(LOG,
302+
(errmsg("could not bind to all requested addresses: MAXLISTEN (%d) exceeded",
303+
MaxListen)));
302304
break;
303305
}
304306

src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.442 2004/12/31 22:00:40 pgsql Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.443 2005/01/12 16:38:17 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -92,6 +92,7 @@
9292
#include <DNSServiceDiscovery/DNSServiceDiscovery.h>
9393
#endif
9494

95+
#include "catalog/pg_control.h"
9596
#include "catalog/pg_database.h"
9697
#include "commands/async.h"
9798
#include "lib/dllist.h"
@@ -167,7 +168,7 @@ int ReservedBackends;
167168
static const char *progname = NULL;
168169

169170
/* The socket(s) we're listening to. */
170-
#define MAXLISTEN 10
171+
#define MAXLISTEN 64
171172
static int ListenSocket[MAXLISTEN];
172173

173174
/*
@@ -337,8 +338,8 @@ typedef struct
337338
#endif
338339
char my_exec_path[MAXPGPATH];
339340
char ExtraOptions[MAXPGPATH];
340-
char lc_collate[MAXPGPATH];
341-
char lc_ctype[MAXPGPATH];
341+
char lc_collate[LOCALE_NAME_BUFLEN];
342+
char lc_ctype[LOCALE_NAME_BUFLEN];
342343
} BackendParameters;
343344

344345
static void read_backend_variables(char *id, Port *port);
@@ -3682,8 +3683,8 @@ save_backend_variables(BackendParameters *param, Port *port,
36823683

36833684
StrNCpy(param->ExtraOptions, ExtraOptions, MAXPGPATH);
36843685

3685-
StrNCpy(param->lc_collate, setlocale(LC_COLLATE, NULL), MAXPGPATH);
3686-
StrNCpy(param->lc_ctype, setlocale(LC_CTYPE, NULL), MAXPGPATH);
3686+
StrNCpy(param->lc_collate, setlocale(LC_COLLATE, NULL), LOCALE_NAME_BUFLEN);
3687+
StrNCpy(param->lc_ctype, setlocale(LC_CTYPE, NULL), LOCALE_NAME_BUFLEN);
36873688

36883689
return true;
36893690
}

0 commit comments

Comments
 (0)