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: 27188
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: Net-Whois-RIPE

People
Owner: lmc [...] cpan.org
Requestors: ilmari+cpan [...] ilmari.org
Cc:
AdminCc:

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



Subject: Attributes with empty first line and continuation
Date: Fri, 18 May 2007 14:38:13 +0100
To: bug-Net-Whois-RIPE [...] rt.cpan.org
From: Dagfinn Ilmari Mannsåker <ilmari [...] ilmari.org>
Hi, I'm using Net::Whois::RIPE::Object to parse the entire RIPE database, but it doesn't handle entries with an empty first line followed by a continuation line (The value gets added to the attribute before). Here's a patch to fix this: --- /usr/share/perl5/Net/Whois/RIPE/Object.pm 2005-10-26 03:05:15.000000000 +0100 +++ ./Net/Whois/RIPE/Object.pm 2007-05-18 14:05:24.000000000 +0100 @@ -92,6 +92,7 @@ $value2 =~ s/\s+$//; $self->add($precedent_attribute, $value2); + $found_record = 1; } elsif (my ($attribute, $value) = /^([\w\-]+|\*\w\w):\s+(.*)$/) { $value =~ s/#.*$// unless exists $Free_Form{$attribute}; $value =~ s/\s+$//; @@ -99,7 +100,8 @@ $self->add($attribute, $value); $precedent_attribute = $attribute; $found_record = 1; - } elsif (/^([\w\-]+|\*\w\w):\s*$/) { + } elsif (my ($attr) = /^([\w\-]+|\*\w\w):\s*$/) { + $precedent_attribute = $attr; } else { $self->_err("unparseable line: '$_'"); } -- ilmari
Subject: Re: [rt.cpan.org #27188] Attributes with empty first line and continuation
Date: Sat, 19 May 2007 07:52:21 +1000
To: bug-Net-Whois-RIPE [...] rt.cpan.org
From: Paul Gampe <paul [...] gampe.id.au>
On Fri, 18 May 2007 11:38:52 pm Dagfinn Ilmari Mannsaker via RT wrote: Show quoted text
> Fri May 18 09:38:51 2007: Request 27188 was acted upon. > Transaction: Ticket created by ilmari > Queue: Net-Whois-RIPE > Subject: Attributes with empty first line and continuation > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: ilmari@ilmari.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=27188 > > > > Hi, > > I'm using Net::Whois::RIPE::Object to parse the entire RIPE database, > but it doesn't handle entries with an empty first line followed by a > continuation line (The value gets added to the attribute before).
Thanks for the patch, would you also be able to provide a test case please? Thanks, Paul
Subject: Re: [rt.cpan.org #27188] Attributes with empty first line and continuation
Date: Mon, 21 May 2007 00:18:25 +0100
To: bug-Net-Whois-RIPE [...] rt.cpan.org
From: Dagfinn Ilmari Mannsåker <ilmari [...] ilmari.org>
On Sun, 2007-05-20 at 17:57 -0400, Paul Gampe via RT wrote: Show quoted text
> On Fri, 18 May 2007 11:38:52 pm Dagfinn Ilmari Mannsaker via RT wrote: >
> > Hi, > > > > I'm using Net::Whois::RIPE::Object to parse the entire RIPE database, > > but it doesn't handle entries with an empty first line followed by a > > continuation line (The value gets added to the attribute before).
> > Thanks for the patch, would you also be able to provide a test case please?
Show quoted text
>From reading the RFC closer (RFC 2622, section 2) it seems that
continued attribute values should be concatenated into one instance of the value, not one instance per line. Also, the spec explicitly allows empty lines (by using + for continuation lines). I'll cook up a new patch that implements this and add tests for all the cases. -- ilmari "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen
RT-Send-CC: md [...] Linux.IT
Ilmari If I understand it correctly, the patch provided by Marco d'Itri resolves his problem and also yours. Many thanks to Marco for the patch and test cases. If you can please test Net::Whois::RIPE release 1.31, it should resolve the problem. :) Cheers! -- Luis Motta Campos is a software engineer, Perl Programmer, foodie and photographer.