aboutsummaryrefslogtreecommitdiff
path: root/src/inetd.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-11-24 18:34:29 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-11-24 18:34:29 +0200
commita7779d56bb758157e122a420a56f2d7b4475e554 (patch)
tree98241b97aa36b7713b2a76677b387cf214a1dbb7 /src/inetd.c
parente6772c4d68849cfdb4547a59bc51cb6dd0acd2c6 (diff)
downloadpies-a7779d56bb758157e122a420a56f2d7b4475e554.tar.gz
pies-a7779d56bb758157e122a420a56f2d7b4475e554.tar.bz2
Implement inetd connection rate.
* src/pies.h (struct component): New member "max_rate". (default_max_rate): New extern. * src/progman.c (check_rate): New function. (check_spawn_rate, check_connection_rate): New functions. (prog_open_socket): New function. (prog_start): Rewrite using the above functions. (_prog_accept): Check connection rate. (progman_start): Special handling for inetd listeners. (progman_wake_sleeping): Likewise. * src/pies.c (default_max_rate): New global. (component_keywords): New keyword max-rate. (options): New option "rate". (parse_opt): Handle the new option. * src/inetd.c (inetd_conf_file): Set max_rate, instead of max_instances.
Diffstat (limited to 'src/inetd.c')
-rw-r--r--src/inetd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inetd.c b/src/inetd.c
index ac40a5a..270425d 100644
--- a/src/inetd.c
+++ b/src/inetd.c
@@ -60,7 +60,7 @@ inetd_conf_file (const char *file)
struct component *comp;
int socket_type;
struct pies_url *url;
- size_t max_instances = 0;
+ size_t max_rate = 0;
int flags = 0;
char *str;
char *user = NULL;
@@ -161,7 +161,7 @@ inetd_conf_file (const char *file)
logmsg (LOG_WARNING, "%s:%lu: invalid number (near %s)",
file, line_no, p);
else
- max_instances = n;
+ max_rate = n;
}
if (strcmp (ws.ws_wordv[IFLD_WAIT], "wait") == 0)
@@ -199,7 +199,7 @@ inetd_conf_file (const char *file)
comp->mode = pies_comp_inetd;
comp->socket_type = socket_type;
comp->socket_url = url;
- comp->max_instances = max_instances;
+ comp->max_rate = max_rate;
comp->flags = flags;
comp->privs.user = xstrdup (user); /* FIXME: memory leak */
if (group)

Return to:

Send suggestions and report system problems to the System administrator.