aboutsummaryrefslogtreecommitdiff
path: root/src/pies.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-23 23:51:39 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-12-23 23:57:48 +0200
commita37a83f6143e672a71ee4436fa24aaa2f9c81877 (patch)
treec5791a295aebf12bf7865f1c100dc3ee72bbc79b /src/pies.c
parentbb72dbbbbac7806a6321a404ec4c852b63e819b7 (diff)
downloadpies-a37a83f6143e672a71ee4436fa24aaa2f9c81877.tar.gz
pies-a37a83f6143e672a71ee4436fa24aaa2f9c81877.tar.bz2
Limit number of connections per socket (IP).
* src/inetd-bi.c (fd_write): Remove. Use fd_report instead. * src/pies.c (component_keywords): New keywords: max-instances-message, max-ip-connections, max-ip-connections-message, access-denied-message. * src/pies.h (struct component): New members: max_ip_connections, access_denied_message, max_instances_message, max_ip_connections_message. (fd_report): New extern. * src/progman.c (conn_class): New struct. (struct prog.p): New member cclass. (conn_tab): New static. (conn_class_lookup, conn_class_report): New functions. (progman_run_comp): Set cclass. (fd_report): New function. (_prog_accept): In case of failure (access denied, etc.) optionally send response strings over the fd. Limit number of connections per socket (IP). (progman_cleanup): Update cclass counter.
Diffstat (limited to 'src/pies.c')
-rw-r--r--src/pies.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pies.c b/src/pies.c
index 91fabca..29f3ed0 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -988,6 +988,25 @@ struct grecs_keyword component_keywords[] = {
grecs_type_size, NULL,
offsetof (struct component, max_instances),
NULL },
+ {"max-instances-message",
+ NULL,
+ N_("Text to send back if max-instances is reached (inetd-components only)."),
+ grecs_type_string, NULL,
+ offsetof (struct component, max_instances_message),
+ NULL },
+ {"max-ip-connections",
+ NULL,
+ N_("Maximum number of simultaneous connections per IP address (inetd only)."),
+ grecs_type_size, NULL,
+ offsetof (struct component, max_ip_connections),
+ NULL },
+ {"max-ip-connections-message",
+ NULL,
+ N_("Text to send back if max-ip-connections-message is reached (inetd only)."),
+ grecs_type_string, NULL,
+ offsetof (struct component, max_ip_connections_message),
+ NULL },
+
{"max-rate",
NULL,
N_("Maximum number of times an inetd component can be invoked in one minute."),
@@ -1020,6 +1039,12 @@ struct grecs_keyword component_keywords[] = {
N_("Set ACL."),
grecs_type_section, NULL, offsetof (struct component, acl),
acl_section_parser, NULL, acl_keywords},
+ {"access-denied-message",
+ NULL,
+ N_("Text to send back if access is denied (inetd-components only)."),
+ grecs_type_string, NULL,
+ offsetof (struct component, access_denied_message),
+ NULL },
{"remove-file",
N_("file"),
N_("Remove file before starting the component."),

Return to:

Send suggestions and report system problems to the System administrator.