summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b171849)
raw | patch | inline | side by side (parent: b171849)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Jan 2008 16:23:08 +0000 (16:23 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Jan 2008 16:23:08 +0000 (16:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8624 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/modules/DBsqlite.pm | patch | blob | history | |
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index b51bd4ed1e0fa0d1947ee75ae2b095dea0e65804..4f298ee037090503f58969c258015af484f8a1b7 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
# check wether all modules are gosa-si valid passwd check
# create session for repeatedly checking the job queue for jobs
-POE::Session->create
-(
+POE::Session->create(
inline_states => {
_start => \&trigger_db_loop,
watch_for_new_jobs => \&watch_for_new_jobs,
);
# create socket for incoming xml messages
-POE::Component::Server::TCP->new
-(
+POE::Component::Server::TCP->new(
Port => $server_port,
ClientInput => \&client_input,
- Concurrency => 10,
);
daemon_log("start socket for incoming xml messages at port '$server_port' ", 1);
index 97d3edf166b4dca3168da83b5a57752d8f8c7b8f..92de527abea51d3a660541bd6e5dfff6f7f8717c 100644 (file)
my $sql_statement = "SELECT MAX(CAST(id AS INTEGER)) FROM $table";
&create_lock($self,'add_dbentry');
my $max_id = @{ @{ $self->{dbh}->selectall_arrayref($sql_statement) }[0] }[0];
- &remove_lock($self,'add_dbentry');
+ &remove_lock($self,'add_dbentry');
if( defined $max_id) {
$id = $max_id + 1;
} else {
sub show_table {
my $self = shift;
my $table_name = shift;
- #&create_lock($self,'show_table');
- #my @res = @{$self->{dbh}->selectall_arrayref( "SELECT * FROM $table_name ORDER BY timestamp")};
- #&remove_lock($self,'show_table');
my $sql_statement= "SELECT * FROM $table_name ORDER BY timestamp";
- &create_lock($self,'show_table');
my $res= &exec_statement($self, $sql_statement);
- &remove_lock($self,'show_table');
my @answer;
foreach my $hit (@{$res}) {
my $answer= -1;
my $sql_statement= "SELECT * FROM $table";
- &create_lock($self,'count_dbentries');
my $db_answer= &select_dbentry($self, $sql_statement);
- &remove_lock($self, 'count_dbentries');
my $count = keys(%{$db_answer});
return $count;
index 1409411ba735f0d425dbd5a9bd9a4c6fda22092e..496ce8d4edb0d015cff3f794aef0bd5473bdfec4 100644 (file)
# RETURNS: socket IO::Socket::INET
# DESCRIPTION: open a socket to PeerAddr
#===============================================================================
-#sub open_socket {
-# my ($PeerAddr, $PeerPort) = @_ ;
-# if(defined($PeerPort)){
-# $PeerAddr = $PeerAddr.":".$PeerPort;
-# }
-# my $socket;
-# $socket = new IO::Socket::INET(PeerAddr => $PeerAddr,
-# Porto => "tcp",
-# Type => SOCK_STREAM,
-# Timeout => 5,
-# );
-# if(not defined $socket) {
-# return;
-# }
-# &daemon_log("open_socket: $PeerAddr", 7);
-# return $socket;
-#}
+sub open_socket {
+ my ($PeerAddr, $PeerPort) = @_ ;
+ if(defined($PeerPort)){
+ $PeerAddr = $PeerAddr.":".$PeerPort;
+ }
+ my $socket;
+ $socket = new IO::Socket::INET(PeerAddr => $PeerAddr,
+ Porto => "tcp",
+ Type => SOCK_STREAM,
+ Timeout => 5,
+ );
+ if(not defined $socket) {
+ return;
+ }
+ &daemon_log("open_socket: $PeerAddr", 7);
+ return $socket;
+}
sub get_time {