diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index e3849b442ae309a6a56b12b402b7fffab0883c0a..590d9668e4a5a62e2d38a884aa684464a417ecdc 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
sub client_input {
no strict "refs";
- my ($heap,$input,$wheel) = @_[HEAP, ARG0, ARG1];
+ my ($kernel, $session, $heap,$input,$wheel) = @_[KERNEL, SESSION, HEAP, ARG0, ARG1];
+ my $session_id = $session->ID;
my ($msg, $msg_hash, $module);
my $error = 0;
my $answer_l;
daemon_log("Incoming msg from '".$heap->{'remote_ip'}."'", 7);
daemon_log("\n$input", 8);
+ ####################
+ # check incoming msg
# msg is from a new client or gosa
($msg, $msg_hash, $module) = &input_from_unknown_host($input);
# msg is from a gosa-si-server or gosa-si-bus
# process incoming msg
if( $error == 0) {
daemon_log("Processing module ".$module, 5);
- $answer_l = &{ $module."::process_incoming_msg" }($msg, $msg_hash, $heap->{'remote_ip'});
+ $answer_l = &{ $module."::process_incoming_msg" }($msg, $msg_hash, $session_id);
if ( 0 > @{$answer_l} ) {
my $answer_str = join("\n", @{$answer_l});
}
}
elsif( $answer_target eq "GOSA" ) {
+ $answer =~ /<session_id>(\d)<\/session_id>/;
+
# answer is for GOSA and has to returned to connected client
my $gosa_answer = &encrypt_msg($answer, $GosaPackages_key);
- $client_answer = $gosa_answer;
+ $client_answer = $gosa_answer."session_id=$1";
}
elsif( $answer_target eq "KNOWN_SERVER" ) {
# answer is for all server in known_server
}
if( $client_answer ) {
- $heap->{client}->put($client_answer);
+
+ if( $client_answer =~ /session_id=(\d+)/ ) {
+ my $session_id = $1;
+ my $session_reference = $kernel->ID_id_to_session($1);
+ my $session_heap = $session_reference->get_heap();
+ $session_heap->{client}->put( $client_answer );
+ }
+ else {
+ $heap->{client}->put($client_answer);
+ }
+
}
return;