path: root/src/pies.h
diff options
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/pies.h
parente6772c4d68849cfdb4547a59bc51cb6dd0acd2c6 (diff)
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/pies.h')
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pies.h b/src/pies.h
index e387a56..5ba6ca7 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -153,7 +153,10 @@ struct component
gl_list_t prereq; /* Prerequisites */
gl_list_t depend; /* Dependency targets */
int flags; /* CF_ bitmask */
- size_t max_instances; /* Maximum number of running instances */
+ size_t max_instances; /* Maximum number of simultaneously running
+ instances (inetd) */
+ size_t max_rate; /* Maximum number of invocations per minute
+ (inetd) */
int socket_type; /* Socket type */
char *rmfile; /* Try to remove this file before starting */
struct pies_privs privs; /* UID/GIDS+groups to run under */
@@ -184,6 +187,7 @@ extern char *mailer_program;
extern char *mailer_command_line;
extern int mailer_argc;
extern char **mailer_argv;
+extern size_t default_max_rate;
void register_prog (struct component *comp);
size_t progman_running_count (void);

Return to:

Send suggestions and report system problems to the System administrator.