1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
--- lirc-0.8.0/daemons/lircd.c 2006/01/22 12:34:38 5.62
+++ lirc-0.8.0/daemons/lircd.c 2006/02/28 21:24:18 5.63
@@ -143,16 +143,18 @@
FILE *lf=NULL;
#endif
-/* fixme: */
+/* quite arbitrary limits */
#define MAX_PEERS 100
+/* substract one for lirc, sockfd, sockinet, logfile, pidfile */
+#define MAX_CLIENTS (FD_SETSIZE-5-MAX_PEERS)
int sockfd, sockinet;
-int clis[FD_SETSIZE-5-MAX_PEERS]; /* substract one for lirc, sockfd, sockinet, logfile, pidfile */
+int clis[MAX_CLIENTS];
#define CT_LOCAL 1
#define CT_REMOTE 2
-int cli_type[FD_SETSIZE-5-MAX_PEERS];
+int cli_type[MAX_CLIENTS];
int clin=0;
int listen_tcpip=0;
@@ -471,7 +473,7 @@
dosigterm(SIGTERM);
};
- if(fd>=FD_SETSIZE)
+ if(fd>=FD_SETSIZE || clin>=MAX_CLIENTS)
{
logprintf(LOG_ERR,"connection rejected");
shutdown(fd,2);
|