This forum has been archived. All content is frozen. Please use KDE Discuss instead.

UPNP freezes with SVN rev 535534

Tags: None
(comma "," separated)
mactalla
Registered Member
Posts
13
Karma
0
OS

UPNP freezes with SVN rev 535534

Sat Apr 29, 2006 6:37 pm
I'm running ktorrent SVN from today (535534) and have just tried setting up UPNP. Unfortunately, when the plugin is loaded, the entire UI freezes. Other posts regarding UPNP don't seem to help my situation.

Here's the log file from ktupnptest:
Code: Select all
UPnPTestApp started up !
Trying to find UPnP devices on the local network
Sending :
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1
MAN:"ssdp:discover"
MX:3


Received :
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Sat, 29 Apr 2006 18:21:23 GMT
EXT:
LOCATION: http://192.168.1.1:2869/gatedesc.xml
SERVER: Linux/2.4.30 UPnP/1.0 Intel UPnP SDK/1.0
ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
USN: uuid:75802409-bccb-40e7-8e6c-fa095ecce13e::urn:schemas-upnp-org:device:InternetGatewayDevice:1



Valid Internet Gateway Device has responded, parsing response....
Location : http://192.168.1.1:2869/gatedesc.xml
Server : Linux/2.4.30 UPnP/1.0 Intel UPnP SDK/1.0
Received :
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Sat, 29 Apr 2006 18:21:23 GMT
EXT:
LOCATION: http://192.168.1.1:2869/gatedesc.xml
SERVER: Linux/2.4.30 UPnP/1.0 Intel UPnP SDK/1.0
ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
USN: uuid:75802409-bccb-40e7-8e6c-fa095ecce13e::urn:schemas-upnp-org:device:InternetGatewayDevice:1



Valid Internet Gateway Device has responded, parsing response....
Location : http://192.168.1.1:2869/gatedesc.xml
Server : Linux/2.4.30 UPnP/1.0 Intel UPnP SDK/1.0
Error parsing XML
Error parsing router description !


Once it hits the error, the UI freezes (ditto in KTorrent itself). It seems to be an infinite loop waiting for a signal or something. At least it's not sucking CPU, I suppose.

It strikes me as strange that it appears to be parsing the *same* .xml file multiple times. Is this the desired behaviour? It also strikes me as odd, that it dies while parsing an xml file that it seems to have previously parsed without error. Are multiple threads clobbering each other, perhaps?

Is there any other information that would help with this?
George
Moderator
Posts
5421
Karma
1

Sun Apr 30, 2006 9:01 am
Do wget http://192.168.1.1:2869/gatedesc.xml

And send that file to me, so I can test it here.
mactalla
Registered Member
Posts
13
Karma
0
OS

datedesc.xml

Sun Apr 30, 2006 2:10 pm
Here it is. Hope it can be fixed!

Code: Select all
<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
   <specVersion>
      <major>1</major>
      <minor>0</minor>
   </specVersion>
   <URLBase>http://192.168.1.1:2869</URLBase>
   <device>
      <deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
      <friendlyName>OpenWrt Linux Internet Gateway Device</friendlyName>
      <manufacturer>OpenWrt Project</manufacturer>
      <manufacturerURL>http://www.openwrt.org</manufacturerURL>
      <modelName>WRT54G(S)</modelName>
      <UDN>uuid:75802409-bccb-40e7-8e6c-fa095ecce13e</UDN>
      <iconList>
         <icon>
            <mimetype>image/gif</mimetype>
            <width>118</width>
            <height>119</height>
            <depth>8</depth>
            <url>/ligd.gif</url>
         </icon>
      </iconList>
      <serviceList>
         <service>
            <serviceType>urn:schemas-microsoft-com:service:OSInfo:1</serviceType>
            <serviceId>urn:microsoft-com:serviceId:OSInfo1</serviceId>
            <controlURL>/upnp/control/OSInfo1</controlURL>
            <eventSubURL>/upnp/event/OSInfo1</eventSubURL>
            <SCPDURL>/gateinfoSCPD.xml</SCPDURL>
         </service>
      </serviceList>
      <deviceList>
         <device>
            <deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType>
            <friendlyName>WANDevice</friendlyName>
            <manufacturer>OpenWrt Project</manufacturer>
            <manufacturerURL>http://www.openwrt.org</manufacturerURL>
            <modelDescription>WAN Device on OpenWrt Router</modelDescription>
            <modelName>WRT54G(S)</modelName>
            <modelNumber>1.0</modelNumber>
            <modelURL>http://www.linksys.com</modelURL>
            <serialNumber>XXXXXXXXXX</serialNumber>
            <UDN>uuid:75802409-bccb-40e7-8e6c-fa095ecce13e</UDN>
            <UPC>Linux IGD</UPC>
            <serviceList>
               <service>
                  <serviceType>urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1</serviceType>
                  <serviceId>urn:upnp-org:serviceId:WANCommonIFC1</serviceId>
                  <controlURL>/upnp/control/WANCommonIFC1</controlURL>
                  <eventSubURL>/upnp/control/WANCommonIFC1</eventSubURL>
                  <SCPDURL>/gateicfgSCPD.xml</SCPDURL>
               </service>
            </serviceList>
            <deviceList>
               <device>
                  <deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType>
                  <friendlyName>WANConnectionDevice</friendlyName>
                  <manufacturer>OpenWrt Project</manufacturer>
                  <manufacturerURL>http://www.openwrt.org</manufacturerURL>
                  <modelDescription>WanConnectionDevice on OpenWrt Router</modelDescription>
                  <modelName>WRT54G(S)</modelName>
                  <modelNumber>1.0</modelNumber>
                  <modelURL>http://www.linksys.com</modelURL>
                  <serialNumber>XXXXXXXXXX</serialNumber>
                  <UDN>uuid:75802409-bccb-40e7-8e6c-fa095ecce13e</UDN>
                  <UPC>Linux IGD</UPC>
                  <serviceList>
                     <service>
                        <serviceType>urn:schemas-upnp-org:service:WANIPConnection:1</serviceType>
                        <serviceId>urn:upnp-org:serviceId:WANIPConn1</serviceId>
                        <controlURL>/upnp/control/WANIPConn1</controlURL>
                        <eventSubURL>/upnp/control/WANIPConn1</eventSubURL>
                        <SCPDURL>/gateconnSCPD.xml</SCPDURL>
                     </service>
                  </serviceList>
               </device>
            </deviceList>
         </device>
      </deviceList>
   <presentationURL>http://192.168.1.1/</presentationURL>
   </device>
</root>
mactalla
Registered Member
Posts
13
Karma
0
OS

Wed May 03, 2006 11:47 pm
Follow-up:

UPnPMCastSocket::onReadyRead() seems to be getting called both when a router replies to the discover() and also from answers to downloadXMLFile(). This seems to make weird things happen (at least for me). My hack was to add a mutex to UPnPMCastSocket::onReadyRead() and to exit the function if the mutex is locked. Seems to be working so far.

Of course this is not a good solution, especially for those people with a setup where more than one device will respond to discover(). I expect having downloadXMLFile() use a throw away socket should fix it up nicer.
George
Moderator
Posts
5421
Karma
1

Thu May 04, 2006 5:45 pm
It didn't crash here, but what you have discovered is interesting.
George
Moderator
Posts
5421
Karma
1

Thu May 04, 2006 5:51 pm
mactalla wrote:Follow-up:

UPnPMCastSocket::onReadyRead() seems to be getting called both when a router replies to the discover() and also from answers to downloadXMLFile(). This seems to make weird things happen (at least for me). My hack was to add a mutex to UPnPMCastSocket::onReadyRead() and to exit the function if the mutex is locked. Seems to be working so far.

Of course this is not a good solution, especially for those people with a setup where more than one device will respond to discover(). I expect having downloadXMLFile() use a throw away socket should fix it up nicer.


downloadXMLFile uses plain old HTTP to download that file, that should be a totally different socket then the multicast socket for UPnP. We use a KDE class to handle this.

Say can you run ethereal on your network and then run ktupnptest ?
I need to see what is going on.
George
Moderator
Posts
5421
Karma
1

Sat May 06, 2006 10:24 am
I have looked over your ethereal trace and it just looks good.

First you do a search for an InternetGatewayDevice. You get 2 replies for that (from the same IP). Then a TCP connection gets made and the file gets downloaded using HTTP.

So everything seems to be OK on the network side.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]