Code

* under construction
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 2 Jun 2008 17:01:23 +0000 (17:01 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 2 Jun 2008 17:01:23 +0000 (17:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11157 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/server/events/gosaTriggered.pm
gosa-si/tests/client.php

index da0ee258cb90f3d70c06b7c8f88dafbd4c3a9b95..0294fb3258113869d35d3ee22ad0ff430370950e 100644 (file)
@@ -368,15 +368,21 @@ sub ping {
     #if ($error != 0) {}
 
     my $message_id;
+    my $i = 0;
     while (1) {
+        $i++;
         $sql = "SELECT * FROM $main::incoming_tn WHERE headertag='answer_$session_id'";
         $res = $main::incoming_db->exec_statement($sql);
         if (ref @$res[0] eq "ARRAY") { 
             $message_id = @{@$res[0]}[0];
             last;
         }
+
+        # do not run into a endless loop
+        if ($i > 100) { last; }
         usleep(100000);
     }
+
     my $answer_xml = @{@$res[0]}[3];
     my %data = ( 'answer_xml'  => 'bin noch da' );
     my $answer_msg = &build_msg("got_ping", $target, $source, \%data);
index 580bc8e350b29276056b8d6fa54f90ac3f3926e5..49d8ed7681eb2f7c92434d5f84243176ed610c41 100755 (executable)
@@ -107,6 +107,7 @@ for($count = 1; $count <= $zahl; $count++)
 
     #$data = "<xml><header>gosa_query_fai_server</header><source>GOSA</source> <target>10.89.1.131:20081</target></xml>";
     $data = "<xml> <header>gosa_ping</header> <target>00:01:6c:9d:aa:16</target> <source>GOSA</source> </xml>";
+    #$data = "<xml> <header>gosa_ping</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>job_ping</header> <source>GOSA</source> <target>00:0c:29:02:e5:4d</target> <macaddress>00:0c:29:02:e5:4d</macaddress><timestamp>29700101000000</timestamp> </xml>";
 
     $sock->write($data);