Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Whois-RIPE CPAN distribution.

Report information
The Basics
Id: 66556
Status: resolved
Priority: 0/
Queue: Net-Whois-RIPE

People
Owner: Nobody in particular
Requestors: mschleifer [...] scogentco.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.00003
Fixed in: (no value)



Subject: option order causes query to fail
If I set recursive => 1 the query returns data. Query sent is 'AS333' (no options) With recursive => 0 query is sent to RIPE as: 'AS333 -r' Which returns no entries found. If I hack the code to produce the query as '-r AS333' it also returns correct data.
From: lmc [...] cpan.org
On Fri Mar 11 16:31:11 2011, https://profiles.google.com/mschleifer wrote: Show quoted text
> If I set recursive => 1 the query returns data. Query sent is 'AS333' (no > options) > > With recursive => 0 query is sent to RIPE as: > > 'AS333 -r' > > Which returns no entries found. > > If I hack the code to produce the query as '-r AS333' it also returns > correct data. >
Hello Mark. I'm already working on it, will keep you posted about my progress. Shouldn't be too hard to fix... Thank you for reporting this. :) Cheers -- LMC -- Luis Motta Campos is a software engineer, Perl Programmer, foodie and photographer.
Hiya Luis, I'm sending you a patch of the current version of the RIPE module, which it's fixing out the problem it was mentioned in this ticket, and also a couple of other bugs that I found it. Please have a look on the patch, and let me know if you want further information. Cheers, Carlos Fuentes El Sáb Mar 12 04:20:59 2011, LMC escribió: Show quoted text
> On Fri Mar 11 16:31:11 2011, https://profiles.google.com/mschleifer > wrote:
> > If I set recursive => 1 the query returns data. Query sent is
> 'AS333' (no
> > options) > > > > With recursive => 0 query is sent to RIPE as: > > > > 'AS333 -r' > > > > Which returns no entries found. > > > > If I hack the code to produce the query as '-r AS333' it also
> returns
> > correct data. > >
> > Hello Mark. > > I'm already working on it, will keep you posted about my progress. > Shouldn't be too hard to > fix... > > Thank you for reporting this. :) > > Cheers > -- > LMC
Subject: Net-Whois-Ripe.patch
--- RIPE.pm 2011-02-13 12:17:43.000000000 +0100 +++ /Library/Perl/5.10.0/Net/Whois/RIPE.pm 2011-10-26 13:21:26.000000000 +0200 @@ -374,9 +374,9 @@ sub send { my ( $self, $message ) = @_; die q{Not connected} unless $self->is_connected; - if ( my $socket = $self->can_write(SOON) ) { - $socket->print( $message, EOL ); - $socket->flush; + if ( $self->ios->can_write(SOON + $self->timeout) ) { + $self->socket->print( $message, EOL ); + $self->socket->flush; return 1; } return 0; @@ -449,10 +449,12 @@ sub query { my ( $self, $query ) = @_; - $query .= q{ } . QUERY_KEEPALIVE if $self->keepalive; - $query .= q{ } . QUERY_NON_RECURSIVE unless $self->recursive; - $query .= q{ } . QUERY_REFERRAL if $self->referral; - return $self->__query($query); + my $parameters= ""; + $parameters .= q{ } . QUERY_KEEPALIVE if $self->keepalive; + $parameters .= q{ } . QUERY_NON_RECURSIVE unless $self->recursive; + $parameters .= q{ } . QUERY_REFERRAL if $self->referral; + my $fullquery = $parameters . $query; + return $self->__query($fullquery); } # Allows me to pass in queries without having all the automatic options added @@ -462,15 +464,16 @@ $self->reconnect unless $self->keepalive; die "Not connected" unless $self->is_connected; - if ( $self->ios->can_write(SOON) ) { + if ( $self->ios->can_write(SOON + $self->timeout) ) { $self->socket->print( $query, EOL ); - return Iterator->new( + + return Iterator->new( sub { local $/ = "\n\n"; - if ( $self->ios->can_read(SOON) ) { - my $block = $self->socket->getline; - return $block if defined $block; - } + if ( $self->ios->can_read(SOON + $self->timeout)) { + my $block = $self->socket->getline; + return $block if defined $block; + } Iterator::is_done; } );
On Wed Oct 26 08:11:21 2011, CARLOSFB wrote: Show quoted text
> Hiya Luis, > > I'm sending you a patch of the current version of the RIPE module, which > it's fixing out the problem it was mentioned in this ticket, and also a > couple of other bugs that I found it.
Hello Carlos. The patch was cristal clear, and my (poor, insufficient) tests are all passing. I believe the bug reported here is fixed, please re-open if you see issues. Cheers! -- Luis Motta Campos is a software engineer, Perl Programmer, foodie and photographer.