Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
47e20d2e
Commit
47e20d2e
authored
12 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
pridana podpora pro maximalni pocet udalosti, ktere si chce klient ze serveru stahnout
parent
4a2fbcab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/warden-server/doc/CHANGELOG
+5
-3
5 additions, 3 deletions
src/warden-server/doc/CHANGELOG
src/warden-server/lib/Warden.pm
+7
-6
7 additions, 6 deletions
src/warden-server/lib/Warden.pm
src/warden-server/lib/WardenConf.pm
+4
-4
4 additions, 4 deletions
src/warden-server/lib/WardenConf.pm
with
16 additions
and
13 deletions
src/warden-server/doc/CHANGELOG
+
5
−
3
View file @
47e20d2e
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 events
- add validation of types of received events
- added limit of events that can be downloaded from server to client
- added receiving of all types of events
- added validation of types of received events
- added support for client maximum received events limit option
(for more information see client documentation)
2012-07-27 v2.0 stable version
...
...
This diff is collapsed.
Click to expand it.
src/warden-server/lib/Warden.pm
+
7
−
6
View file @
47e20d2e
...
...
@@ -255,6 +255,7 @@ sub getNewEvents
# parse SOAP data object
my
$requested_type
=
$data
->
{'
REQUESTED_TYPE
'};
my
$last_id
=
$data
->
{'
LAST_ID
'};
my
$max_rcv_events_limit
=
$data
->
{'
MAX_RCV_EVENTS_LIMIT
'};
my
%client
=
authorizeClient
(
$alt_names
,
$ip
,
$requested_type
,
$client_type
,
$function_name
);
if
(
defined
%client
)
{
...
...
@@ -262,11 +263,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_EVENTS_LIMIT
);
(
$max_rcv_events_limit
<
$MAX_EVENTS_LIMIT
)
?
$sth
->
execute
(
$last_id
,
$max_rcv_events_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_EVENTS_LIMIT
);
(
$max_rcv_events_limit
<
$MAX_EVENTS_LIMIT
)
?
$sth
->
execute
(
$last_id
,
$requested_type
,
$max_rcv_events_limit
)
:
$sth
->
execute
(
$last_id
,
$requested_type
,
$MAX_EVENTS_LIMIT
);
}
}
else
{
if
(
$requested_type
eq
'
_any_
')
{
...
...
@@ -274,13 +275,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_EVENTS_LIMIT
);
(
$max_rcv_events_limit
<
$MAX_EVENTS_LIMIT
)
?
$sth
->
execute
(
$last_id
,
$domain
,
$max_rcv_events_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_EVENTS_LIMIT
);
(
$max_rcv_events_limit
<
$MAX_EVENTS_LIMIT
)
?
$sth
->
execute
(
$last_id
,
$requested_type
,
$domain
,
$max_rcv_events_limit
)
:
$sth
->
execute
(
$last_id
,
$requested_type
,
$domain
,
$MAX_EVENTS_LIMIT
);
}
}
...
...
@@ -323,9 +324,9 @@ sub getNewEvents
# log sent ID of events
if
(
scalar
@events
!=
0
)
{
if
(
scalar
@ids
==
1
)
{
write2log
("
info
",
"
Sent 1 event
s
[#
$ids
[0]] to
$ip
(CN(AN):
$alt_names
)
");
write2log
("
info
",
"
Sent 1 event [#
$ids
[0]] to
$ip
(CN(AN):
$alt_names
)
with client limit
$max_rcv_events_limit
events
");
}
else
{
write2log
("
info
",
"
Sent
"
.
scalar
@ids
.
"
events [#
$ids
[0] - #
$ids
[-1]] to
$ip
(CN(AN):
$alt_names
)
");
write2log
("
info
",
"
Sent
"
.
scalar
@ids
.
"
events [#
$ids
[0] - #
$ids
[-1]] to
$ip
(CN(AN):
$alt_names
)
with client limit
$max_rcv_events_limit
events
");
}
}
return
@events
;
...
...
This diff is collapsed.
Click to expand it.
src/warden-server/lib/WardenConf.pm
+
4
−
4
View file @
47e20d2e
...
...
@@ -20,10 +20,10 @@ sub loadConf
my
$conf_file
=
shift
;
# preset of default variables
our
$URI
=
undef
;
our
$SSL_KEY_FILE
=
undef
;
our
$SSL_CERT_FILE
=
undef
;
our
$SSL_CA_FILE
=
undef
;
our
$URI
=
undef
;
our
$SSL_KEY_FILE
=
undef
;
our
$SSL_CERT_FILE
=
undef
;
our
$SSL_CA_FILE
=
undef
;
# read config file
if
(
!
open
(
TMP
,
$conf_file
)
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment