[sr-dev] git:master: core: take into account mhomed when estimated max_fd_no

Andrei Pelinescu-Onciul andrei at iptel.org
Mon Feb 1 20:20:04 CET 2010


Module: sip-router
Branch: master
Commit: a1bd3d76dd929fdf56040def405495fb2e4e5d7c
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a1bd3d76dd929fdf56040def405495fb2e4e5d7c

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Mon Feb  1 19:55:30 2010 +0100

core: take into account mhomed when estimated max_fd_no

Since commit ead9f3f, mhomed might use 1 or 2 (IPV6 enabled) fds
per process for caching socket descriptors.

---

 pt.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/pt.c b/pt.c
index db6918f..a288723 100644
--- a/pt.c
+++ b/pt.c
@@ -89,11 +89,20 @@ static int calc_common_open_fds_no()
 	/* 1 tcp send unix socket/all_proc, 
 	 *  + 1 udp sock/udp proc + 1 possible dns comm. socket + 
 	 *  + 1 temporary tcp send sock.
+	 * Per process:
+	 *  + 1 if mhomed (now mhomed keeps a "cached socket" per process)
+	 *  + 1 if mhomed & ipv6
 	 */
 	max_fds_no=estimated_proc_no*4 /* udp|sctp + tcp unix sock +
 									  tmp. tcp send +
 									  tmp dns.*/
-				-1 /* timer (no udp)*/ + 3 /* stdin/out/err */;
+				-1 /* timer (no udp)*/ + 3 /* stdin/out/err */ +
+#ifdef USE_IPV6
+				2*mhomed
+#else
+				mhomed
+#endif /* USE_IPV6*/
+				;
 	return max_fds_no;
 }
 




More information about the sr-dev mailing list