[libnet-dbus-perl] 143/335: Rip out variable timeout crap, since its overcomplicated and dosn't add significant value
Intrigeri
intrigeri at moszumanska.debian.org
Sat Mar 21 01:07:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.
commit 4e72273cffbbbb0122f34599063ce0ca0cc8b450
Author: Daniel P. Berrange <dan at berrange.com>
Date: Sun Oct 23 15:28:44 2005 +0000
Rip out variable timeout crap, since its overcomplicated and dosn't add significant value
---
lib/Net/DBus/RemoteObject.pm | 34 +++++++++-------------------------
1 file changed, 9 insertions(+), 25 deletions(-)
diff --git a/lib/Net/DBus/RemoteObject.pm b/lib/Net/DBus/RemoteObject.pm
index 840ea55..0a7ad68 100644
--- a/lib/Net/DBus/RemoteObject.pm
+++ b/lib/Net/DBus/RemoteObject.pm
@@ -16,7 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# $Id: RemoteObject.pm,v 1.16 2005/10/17 22:28:01 dan Exp $
+# $Id: RemoteObject.pm,v 1.17 2005/10/23 16:28:44 dan Exp $
=pod
@@ -148,8 +148,6 @@ sub get_object_path {
sub _introspector {
my $self = shift;
- my $timeout = shift;
- $timeout = $self->get_service->is_online ? 5 : 60 unless defined $timeout;
unless ($self->{introspected}) {
my $call = Net::DBus::Binding::Message::MethodCall->
@@ -162,7 +160,7 @@ sub _introspector {
my $reply = $self->{service}->
get_bus()->
get_connection()->
- send_with_reply_and_block($call, $timeout * 1000);
+ send_with_reply_and_block($call, 60 * 1000);
my $iter = $reply->iterator;
return $iter->get(&Net::DBus::Binding::Message::TYPE_STRING);
@@ -242,7 +240,7 @@ sub connect_to_signal {
},
$name,
$interface,
- $self->{service}->get_service_name(),
+ $self->{service}->get_owner_name(),
$self->{object_path});
}
@@ -258,21 +256,8 @@ sub AUTOLOAD {
(my $name = $AUTOLOAD) =~ s/.*:://;
- # Use a long timeout if the service is not online,
- # because some services take a long time to startup.
- # With a 5 second timeout, we'd time out before the
- # service was fully activated.
- # Also use a long timeout on the GetNameOwner and
- # StartServiceByName methods since they trigger
- # the activation process
- my $timeout = !$self->get_service->is_online ||
- ($self->get_service->get_service_name eq "org.freedesktop.DBus" &&
- $self->get_object_path eq "/org/freedesktop/DBus" &&
- ($name eq "GetNameOwner" ||
- $name eq "StartServiceByName")) ? 60 : 5;
-
my $interface = $self->{interface};
- my $ins = $self->_introspector($timeout);
+ my $ins = $self->_introspector();
if ($ins) {
my @interfaces = $ins->has_method($name);
@@ -282,7 +267,7 @@ sub AUTOLOAD {
"in multiple interfaces of '" . $self->get_object_path . "'" .
"calling first interface only\n";
}
- return $self->_call_method($name, $interfaces[0], $timeout, @_);
+ return $self->_call_method($name, $interfaces[0], @_);
}
@interfaces = $ins->has_property($name);
@@ -293,10 +278,10 @@ sub AUTOLOAD {
"calling first interface only\n";
}
if (@_) {
- $self->_call_method("Set", "org.freedesktop.DBus.Properties", $timeout, $interfaces[0], $name, $_[0]);
+ $self->_call_method("Set", "org.freedesktop.DBus.Properties", $interfaces[0], $name, $_[0]);
return ();
} else {
- return $self->_call_method("Get", "org.freedesktop.DBus.Properties", $timeout, $interfaces[0], $name);
+ return $self->_call_method("Get", "org.freedesktop.DBus.Properties", $interfaces[0], $name);
}
}
die "no method or property with name '$name' is exported in object '" .
@@ -307,7 +292,7 @@ sub AUTOLOAD {
"', and object is not cast to any interface";
}
- return $self->_call_method($name, $interface, $timeout, @_);
+ return $self->_call_method($name, $interface, @_);
}
}
@@ -316,7 +301,6 @@ sub _call_method {
my $self = shift;
my $name = shift;
my $interface = shift;
- my $timeout = shift;
my $call = Net::DBus::Binding::Message::MethodCall->
new(service_name => $self->{service}->get_service_name(),
@@ -334,7 +318,7 @@ sub _call_method {
my $reply = $self->{service}->
get_bus()->
get_connection()->
- send_with_reply_and_block($call, $timeout * 1000);
+ send_with_reply_and_block($call, 60 * 1000);
my @reply;
if ($ins) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git
More information about the Pkg-perl-cvs-commits
mailing list