Skip Menu |

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

Report information
The Basics
Id: 46817
Status: resolved
Priority: 0/
Queue: Net-UPnP

People
Owner: Nobody in particular
Requestors: engler [...] gmail.com
Cc:
AdminCc:

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



Subject: Issue with Net::UPnP::Device::getdescription()
getdescription() uses a greedy match when it finds data for xml tags I think it should be changed to a non-greedy match, as follows: *** Net/UPnP/Device.pm Tue Jun 9 21:27:50 2009 --- Net/UPnP/Device_old.pm Tue Jun 9 21:27:28 2009 *************** *** 62,68 **** @_, ); if ($args{name}) { ! unless ($this->{$Net::UPnP::Device::_DESCRIPTION} =~ m/<$args{name}>(.*?)<\/$args{name}>/i) { return ''; } return $1; --- 62,68 ---- @_, ); if ($args{name}) { ! unless ($this->{$Net::UPnP::Device::_DESCRIPTION} =~ m/<$args{name}>(.*)<\/$args{name}>/i) { return ''; } return $1; Otherwise it makes a mistake if another part of the file contains the end tag, such as the response I got from an internetgatewaydevice (attached).
Subject: bad_upnp_response.txt
<root xmlns="urn:schemas-upnp-org:device-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType> <friendlyName>Linux router</friendlyName> <manufacturer>Linux</manufacturer> <manufacturerURL>http://www.kernel.org/</manufacturerURL> <modelDescription>Linux router</modelDescription> <modelName>Linux router</modelName> <modelNumber>69</modelNumber> <modelURL>http://www.kernel.org/</modelURL> <serialNumber>1337</serialNumber> <UDN>uuid:d47812d8-10ef-4f46-b9d7-fb61b7af150d</UDN> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType> <serviceId>urn:upnp-org:serviceId:Layer3Forwarding1</serviceId> <controlURL>/ctl/L3F</controlURL> <eventSubURL>/evt/L3F</eventSubURL> <SCPDURL>/L3F.xml</SCPDURL> </service> </serviceList> <deviceList> <device> <deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType> <friendlyName>WANDevice</friendlyName> <manufacturer>MiniUPnP</manufacturer> <manufacturerURL>http://miniupnp.free.fr/</manufacturerURL> <modelDescription>WAN Device</modelDescription> <modelName>WAN Device</modelName> <modelNumber>20090514</modelNumber> <modelURL>http://miniupnp.free.fr/</modelURL> <serialNumber>1337</serialNumber> <UDN>uuid:d47812d8-10ef-4f46-b9d7-fb61b7af150d</UDN> <UPC>MINIUPNPD</UPC> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1</serviceType> <serviceId>urn:upnp-org:serviceId:WANCommonIFC1</serviceId> <controlURL>/ctl/CmnIfCfg</controlURL> <eventSubURL>/evt/CmnIfCfg</eventSubURL> <SCPDURL>/WANCfg.xml</SCPDURL> </service> </serviceList> <deviceList> <device> <deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType> <friendlyName>WANConnectionDevice</friendlyName> <manufacturer>MiniUPnP</manufacturer> <manufacturerURL>http://miniupnp.free.fr/</manufacturerURL> <modelDescription>MiniUPnP daemon</modelDescription> <modelName>MiniUPnPd</modelName> <modelNumber>20090514</modelNumber> <modelURL>http://miniupnp.free.fr/</modelURL> <serialNumber>1337</serialNumber> <UDN>uuid:d47812d8-10ef-4f46-b9d7-fb61b7af150d</UDN> <UPC>MINIUPNPD</UPC> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:WANIPConnection:1</serviceType> <serviceId>urn:upnp-org:serviceId:WANIPConn1</serviceId> <controlURL>/ctl/IPConn</controlURL> <eventSubURL>/evt/IPConn</eventSubURL> <SCPDURL>/WANIPCn.xml</SCPDURL> </service> </serviceList> </device> </deviceList> </device> </deviceList> <presentationURL>http://10.1.1.1/index.php</presentationURL> </device> </root>
Hi Tim, I have added your changes into the following latest repository yesterday. http://clinkperl.svn.sourceforge.net/viewvc/clinkperl/trunk/lib/Net/UPnP/Device.pm?r1=8&r2=17 Thanks for your report :-)