X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FPod.pm;h=27ae050b484d20cc2ced83647480cd3535bcf798;hp=23c714d754d38de88b62c876f76eef6906d1e99a;hb=cadde72b589f2b46e3cfc4457d3261834a2641fd;hpb=d4d8c2434ea5f5e3beb4cfd5d508e8f07e0e946c diff --git a/lib/ZOOM/Pod.pm b/lib/ZOOM/Pod.pm index 23c714d..27ae050 100644 --- a/lib/ZOOM/Pod.pm +++ b/lib/ZOOM/Pod.pm @@ -1,4 +1,4 @@ -# $Id: Pod.pm,v 1.13 2006-06-21 14:31:24 mike Exp $ +# $Id: Pod.pm,v 1.16 2006-07-21 10:58:42 mike Exp $ package ZOOM::Pod; @@ -265,6 +265,10 @@ indicates whether C should continue (return-value 0) or return immediately (any other value). Exception-handling callbacks may of course re-throw the exception. +Connections that have the C option set are omitted from +consideration. This is useful if, for example, a connection that is +part of a pod is known to have encountered an unrecoverable error. + =cut sub wait { @@ -272,8 +276,29 @@ sub wait { my($arg) = @_; my $res = 0; - while ((my $i = ZOOM::event($this->{conn})) != 0) { + + while (1) { + my @conn; + my @idxmap; # maps indexes into conn to global indexes + foreach my $i (0 .. @{ $this->{conn} }-1) { + my $conn = $this->{conn}->[$i]; + if ($conn->option("pod_omit")) { + ZOOM::Log::log("pod", "connection $i omitted (", + $conn->option("host"), ")"); + } else { + push @conn, $conn; + push @idxmap, $i; + ZOOM::Log::log("pod", "connection $i included (", + $conn->option("host"), ")"); + } + } + + my $i0 = ZOOM::event(\@conn); + last if $i0 == 0; + my $i = 1+$idxmap[$i0-1]; my $conn = $this->{conn}->[$i-1]; + die "connection-mapping screwup" if $conn ne $conn[$i0-1]; + my $ev = $conn->last_event(); my $evstr = ZOOM::event_str($ev); ZOOM::Log::log("pod", "connection ", $i-1, ": event $ev ($evstr)");