diff --git a/src/warden-server/doc/CHANGELOG b/src/warden-server/doc/CHANGELOG index 18133f5d27b4996ea389f4f1f6bf10bb847b4686..d72926ebf2f1a9cb76499c317be122dbc71fc6ca 100644 --- a/src/warden-server/doc/CHANGELOG +++ b/src/warden-server/doc/CHANGELOG @@ -1,7 +1,8 @@ 2012-00-00 v2.1 stable version ------------------------------ - add limit of events that can be downloaded from server to client -- add receiving of all types of messages +- add receiving of all types of events +- add validation of types of received events 2012-07-27 v2.0 stable version diff --git a/src/warden-server/doc/README b/src/warden-server/doc/README index 0a775a83b9c1760e0e641b98a7c58c1e7cf44d7d..fd94409811ea75c85532d87dd2568440b2ef810f 100644 --- a/src/warden-server/doc/README +++ b/src/warden-server/doc/README @@ -157,7 +157,7 @@ C. Installation DB_HOST - MySQL database host e.g. localhost - MAX_EVENT_LIMIT - maximum number of events that can be downloaded from Warden server + MAX_EVENTS_LIMIT - maximum number of events that can be downloaded from Warden server in a single getNewEvents client function call e.g. 2000000 diff --git a/src/warden-server/etc/warden-server.conf b/src/warden-server/etc/warden-server.conf index 5a99105010fb5b1009c824defa64ffdb03d81cfc..78d29a08b13b9ea0acfdd9e1c4821b9225ba0b80 100644 --- a/src/warden-server/etc/warden-server.conf +++ b/src/warden-server/etc/warden-server.conf @@ -33,10 +33,10 @@ $DB_PASS = ""; $DB_HOST = "localhost"; #------------------------------------------------------------------------------- -# MAX_EVENT_LIMIT - maximum number of events that can be downloaded from +# MAX_EVENTS_LIMIT - maximum number of events that can be downloaded from # Warden server in a single getNewEvents client function call #------------------------------------------------------------------------------- -$MAX_EVENT_LIMIT = "1000000"; +$MAX_EVENTS_LIMIT = "1000000"; #------------------------------------------------------------------------------- # VALID_STRINGS - validation hash containing allowed event attributes diff --git a/src/warden-server/lib/Warden.pm b/src/warden-server/lib/Warden.pm index 31abf07a2cc991c6d330b5add64ca95158c46291..e210653eaf0691bb9f640cd0a040e07438ae94b1 100755 --- a/src/warden-server/lib/Warden.pm +++ b/src/warden-server/lib/Warden.pm @@ -33,7 +33,7 @@ our $DB_NAME = undef; our $DB_USER = undef; our $DB_PASS = undef; our $DB_HOST = undef; -our $MAX_EVENT_LIMIT = undef; +our $MAX_EVENTS_LIMIT = undef; our %VALID_STRINGS = undef; # read config file @@ -262,11 +262,11 @@ sub getNewEvents if ($requested_type eq '_any_') { # check if client want each or only one type of messages $sth = $DBH->prepare("SELECT * FROM events WHERE type != 'test' AND id > ? AND valid = 't' ORDER BY id ASC LIMIT ?;"); if (!defined $sth) {die("Cannot prepare ROE-ANY statement in $function_name: $DBI::errstr\n")} - $sth->execute($last_id, $MAX_EVENT_LIMIT); + $sth->execute($last_id, $MAX_EVENTS_LIMIT); } else { $sth = $DBH->prepare("SELECT * FROM events WHERE type != 'test' AND id > ? AND type = ? AND valid = 't' ORDER BY id ASC LIMIT ?;"); if (!defined $sth) {die("Cannot prepare ROE statement in $function_name: $DBI::errstr\n")} - $sth->execute($last_id, $requested_type, $MAX_EVENT_LIMIT); + $sth->execute($last_id, $requested_type, $MAX_EVENTS_LIMIT); } } else { if ($requested_type eq '_any_') { @@ -274,13 +274,13 @@ sub getNewEvents if (!defined $sth) {die("Cannot prepare ANY statement in $function_name: $DBI::errstr\n")} my ($domain) = $cn =~ /([^\.]+\.[^\.]+)$/; $domain = '\%' . $domain; - $sth->execute($last_id, $domain, $MAX_EVENT_LIMIT); + $sth->execute($last_id, $domain, $MAX_EVENTS_LIMIT); } else { $sth = $DBH->prepare("SELECT * FROM events WHERE type != 'test' AND id > ? AND type = ? AND valid = 't' AND hostname NOT LIKE ? ORDER BY id ASC LIMIT ?;"); if (!defined $sth) {die("Cannot prepare statement in $function_name: $DBI::errstr\n")} my ($domain) = $cn =~ /([^\.]+\.[^\.]+)$/; $domain = '\%' . $domain; - $sth->execute($last_id, $requested_type, $domain, $MAX_EVENT_LIMIT); + $sth->execute($last_id, $requested_type, $domain, $MAX_EVENTS_LIMIT); } } diff --git a/src/warden-server/sh/install.sh b/src/warden-server/sh/install.sh index 82e15ddfb5656b4f207c22c7e98620a329e649a4..0485dab70f88c233e500cf78ac5f2eef41aaa284 100755 --- a/src/warden-server/sh/install.sh +++ b/src/warden-server/sh/install.sh @@ -223,10 +223,10 @@ make_server_conf() \$DB_HOST = \"localhost\"; #------------------------------------------------------------------------------- -# MAX_EVENT_LIMIT - maximum number of events that can be downloaded from +# MAX_EVENTS_LIMIT - maximum number of events that can be downloaded from # Warden server in a single getNewEvents client function call #------------------------------------------------------------------------------- -\$MAX_EVENT_LIMIT = \"1000000\"; +\$MAX_EVENTS_LIMIT = \"1000000\"; #------------------------------------------------------------------------------- # VALID_STRINGS - validation hash containing allowed event attributes