Changeset 1323

Show
Ignore:
Timestamp:
03/04/08 23:22:22 (8 months ago)
Author:
kindlund
Message:

Added additional customized timeouts to RPC communications w/ Drone service.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/trunk/lib/HoneyClient/Manager/Database.pm

    r1319 r1323  
    221221    $name =~  s/.*://; 
    222222 
     223    # Set a custom timeout. 
     224    my $ua = LWP::UserAgent->new(); 
     225    $ua->timeout(getVar(name => "timeout")); 
     226    my %options = ( 
     227        lwp_useragent => $ua, 
     228    ); 
     229 
    223230    # Perform the RPC call. 
    224     my $xmlrpc = XML::RPC->new(getVar(name => "url")); 
     231    my $xmlrpc = XML::RPC->new(getVar(name => "url"), %options); 
    225232    my $ret = undef; 
    226233    
    227234    eval { 
    228        $ret = $xmlrpc->call($name,@_); 
    229    }; 
     235        $ret = $xmlrpc->call($name,@_); 
     236    }; 
    230237 
    231238    # Error checking. 
    232239    if ($@ || !defined($ret)) { 
    233        $LOG->error("Error: RPC communications failure."); 
    234        Carp::croak("Error: RPC communications failure."); 
    235    
     240        $LOG->error("Error: RPC communications failure."); 
     241        Carp::croak("Error: RPC communications failure."); 
     242   
    236243 
    237244    # Error checking. 
    238245    if ((ref($ret) eq "HASH") && (exists($ret->{faultCode}))) { 
    239        $LOG->error("Error: " . $ret->{faultString}); 
     246        $LOG->error("Error: " . $ret->{faultString}); 
    240247        Carp::croak("Error: " . $ret->{faultString}); 
    241248    }