Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#7 Patches for UPnP Forum compliance

open
nobody
None
5
2010-06-07
2010-06-07
Enrico Gueli
No

Hello,
since I had access to the UPnP Forum certification tool, I had the chance to test your wonderful UPnP stack against it. I've made tests about device/service description, discovery, action control and eventing, finding some bugs that I somewhat managed to fix. Here is a summary of the bugfixes, and the modified files:

- If no allowed values were specified for an action, the resulting SCPD had an empty <allowedValueList> element, which is prohibited by the UDA.
+++ src/main/java/org/cybergarage/upnp/Action.java (working copy)

- In an M-SEARCH response, the device was responding three times with the same notification (or two if it's an embedded device). Instead, the device should respond with two/three notifications with different ST and USN headers, as described in UDA sect. 1.1.2.
+++ src/main/java/org/cybergarage/upnp/Device.java (working copy)

- The "::upnp-rootdevice" suffix was appended to the USN of all notifications, no matter which kind of search was received. Instead, this should be done only for ssdp:all and upnp:rootdevice search targets.
+++ src/main/java/org/cybergarage/upnp/Device.java (working copy)

- When responding with multiple notifications, there was a random delay from 0 to MX between each notification. This leads to timeouts; instead, all expected notifications must be sent no more than MX seconds since the search request.
+++ src/main/java/org/cybergarage/upnp/Device.java (working copy)
+++ src/main/java/org/cybergarage/upnp/Service.java (working copy)

- localAddr was incorrectly overwritten with HostInterface.getInterface() with no apparent reason.
+++ src/main/java/org/cybergarage/upnp/Device.java (working copy)

- At startup, the device sent ssdp:byebye notifications before ssdp:alive notifications.
+++ src/main/java/org/cybergarage/upnp/Device.java (working copy)

- An SSDP search was accepted even with a malformed header (i.e. first line with missing fields).
+++ src/main/java/org/cybergarage/upnp/ssdp/MalformedPacketException.java (revision 0)
+++ src/main/java/org/cybergarage/upnp/ssdp/SSDPNotifySocket.java (working copy)
+++ src/main/java/org/cybergarage/upnp/ssdp/SSDPNotifySocket.java (working copy)
+++ src/main/java/org/cybergarage/upnp/ssdp/SSDPPacket.java (working copy)
+++ src/main/java/org/cybergarage/upnp/ssdp/SSDPSearchSocket.java (working copy)

- When subscribing, the device responds with a NOTIFY for each state variable. Instead, a single NOTIFY should be sent containing all the state variables.
+++ src/main/java/org/cybergarage/upnp/event/NotifyRequest.java (working copy)
+++ src/main/java/org/cybergarage/upnp/Service.java (working copy)

- The XML contained in the NOTIFY packets specifies a namespace with a "p" prefix, but is was never used.
+++ src/main/java/org/cybergarage/upnp/event/NotifyRequest.java (working copy)

- The SSDPPacket class now "fills itself" with the data coming from a DatagramSocket. This allows for internal verification of headers.
+++ src/main/java/org/cybergarage/upnp/ssdp/HTTPMUSocket.java (working copy)
+++ src/main/java/org/cybergarage/upnp/ssdp/HTTPUSocket.java (working copy)
+++ src/main/java/org/cybergarage/upnp/ssdp/SSDPPacket.java (working copy)

- Randomly generated UUIDs now follow RFC 4122.
+++ src/main/java/org/cybergarage/upnp/UPnP.java (working copy)

- If the subscription has no timeout, a wrong "TIMEOUT: infinite" header was returned. The correct syntax is "TIMEOUT: Second-infinite".
+++ src/main/java/org/cybergarage/upnp/event/Subscription.java (working copy)

- The UPnP Certification Tool requires two blank lines following the last header of a subscription response.
+++ src/main/java/org/cybergarage/upnp/event/SubscriptionResponse.java (working copy)

Best regards,
Enrico Gueli

Discussion