diff options
Diffstat (limited to '')
-rw-r--r-- | ts3db.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3,7 +3,7 @@ #include <stdbool.h> #include <string.h> -#define MAX_CONNECTIONS 100 +#define MAX_CONNECTIONS 99 typedef struct { PGconn *conn; @@ -88,6 +88,10 @@ int ts3dbplugin_connect(unsigned int *connection_nr) { PGconn *conn; + if (connection_count >= MAX_CONNECTIONS) { + return 0; + } + conn = PQconnectdbParams(keywords, (const char **)&settings, true); if (PQstatus(conn) != CONNECTION_OK) { log(PQerrorMessage(conn), LOG_CRITICAL); |