Changeset 1323
- Timestamp:
- 03/04/08 23:22:22 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/trunk/lib/HoneyClient/Manager/Database.pm
r1319 r1323 221 221 $name =~ s/.*://; 222 222 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 223 230 # Perform the RPC call. 224 my $xmlrpc = XML::RPC->new(getVar(name => "url") );231 my $xmlrpc = XML::RPC->new(getVar(name => "url"), %options); 225 232 my $ret = undef; 226 233 227 234 eval { 228 $ret = $xmlrpc->call($name,@_);229 };235 $ret = $xmlrpc->call($name,@_); 236 }; 230 237 231 238 # Error checking. 232 239 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 } 236 243 237 244 # Error checking. 238 245 if ((ref($ret) eq "HASH") && (exists($ret->{faultCode}))) { 239 $LOG->error("Error: " . $ret->{faultString});246 $LOG->error("Error: " . $ret->{faultString}); 240 247 Carp::croak("Error: " . $ret->{faultString}); 241 248 }
