aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 14eefdfb3..5a764f91f 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -859,7 +859,6 @@ run (void *cls,
859 } 859 }
860 860
861 max_fd_rlimit = 0; 861 max_fd_rlimit = 0;
862 max_fd_cfg = 0;
863#if HAVE_GETRLIMIT 862#if HAVE_GETRLIMIT
864 struct rlimit r_file; 863 struct rlimit r_file;
865 if (0 == getrlimit (RLIMIT_NOFILE, &r_file)) 864 if (0 == getrlimit (RLIMIT_NOFILE, &r_file))
@@ -872,10 +871,12 @@ run (void *cls,
872 } 871 }
873 max_fd_rlimit = (9 * max_fd_rlimit) / 10; /* Keep 10% for rest of transport */ 872 max_fd_rlimit = (9 * max_fd_rlimit) / 10; /* Keep 10% for rest of transport */
874#endif 873#endif
875 GNUNET_CONFIGURATION_get_value_number (GST_cfg, 874 if (GNUNET_OK !=
876 "transport", 875 GNUNET_CONFIGURATION_get_value_number (GST_cfg,
877 "MAX_FD", 876 "transport",
878 &max_fd_cfg); 877 "MAX_FD",
878 &max_fd_cfg))
879 max_fd_cfg = max_fd_rlimit;
879 880
880 if (max_fd_cfg > max_fd_rlimit) 881 if (max_fd_cfg > max_fd_rlimit)
881 max_fd = max_fd_cfg; 882 max_fd = max_fd_cfg;
@@ -886,7 +887,9 @@ run (void *cls,
886 887
887 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 888 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
888 "Limiting number of sockets to %u: validation %u, neighbors: %u\n", 889 "Limiting number of sockets to %u: validation %u, neighbors: %u\n",
889 max_fd, (max_fd / 3), (max_fd / 3) * 2); 890 max_fd,
891 (max_fd / 3),
892 (max_fd / 3) * 2);
890 893
891 friend_only = GNUNET_CONFIGURATION_get_value_yesno (GST_cfg, 894 friend_only = GNUNET_CONFIGURATION_get_value_yesno (GST_cfg,
892 "topology", 895 "topology",