Skip to content
Snippets Groups Projects
Commit 2e278147 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

zmena nazvu promenne ->

parent 7d408702
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -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
......
......@@ -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
......
......@@ -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);
}
}
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment