Project

General

Profile

Bug #381 » get_whole_list.diff

Pavel Kácha, 03/15/2012 10:22 AM

View differences:

/home/ph/WardenClientReceive.pm 2012-03-15 09:39:32.000000000 +0100
150 150
  ));
151 151
  my $response = c2s($uri, $ssl_key_file, $ssl_cert_file, $ssl_ca_file, "getNewEvents", $request_data);
152 152

  
153
  # match getNewEvents functions response
154
  $response->match('/Envelope/Body/getNewEventsResponse/');
155 153
  my ($id, $hostname, $service, $detected, $type, $source_type, $source, $target_proto, $target_port, $attack_scale, $note, $priority, $timeout);
156 154
  my @events;
157 155

  
158 156
  # parse returned SOAP data object
159
  my $i = 1;
160
  my $response_data = $response->valueof("[$i]");
161
  while (defined $response_data) {
157
  my @response_list = $response->valueof('/Envelope/Body/getNewEventsResponse/event/');
158
  while (scalar @response_list) {
159
    my $response_data = shift(@response_list);
162 160
    my @event;
163 161

  
164 162
    # parse items of one event
......
184 182
    if ($id > $last_id) {
185 183
	    $last_id = $id;
186 184
    }
187

  
188
    # go to the next received event
189
    $i++;
190
    $response_data = $response->valueof("[$i]");
191 185
  }
192 186

  
193 187
  # write last return ID
    (1-1/1)