Thank you for the patch. I do have a question though : could the alarm(0) be moved into the if($@) { block? Would this be cleaner?
On 14-Oct-2009 flw wrote: > When it working with a server which used Non-IKC protocol, > alarm( $self->{connect_timeout} ) will break user process via > SIGALRMï¼default behaviourï¼ > > Following patch is based on: > $Id: ClientLite.pm 495 2009-05-08 19:46:42Z fil $ > > > --- ClientLite.pm.orig 2009-10-14 11:35:38.000000000 +0800 > +++ ClientLite.pm 2009-10-14 11:36:06.000000000 +0800 > @@ -136,11 +136,11 @@ > alarm( $self->{connect_timeout} ); > $sock->print('WORLD'); # phase 003 > chomp($resp=$sock->getline); > - alarm( 0 ); > die "Phase 003: $!\n" unless defined $resp; > die "Didn't get UP from $name\n" unless $resp eq 'UP'; > $DONE = 1; > }; > + alarm( 0 ); > if($@) > { > $self->{error}=$error=$@;