Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subscription NOTIFY parsing problem
06-04-2014, 10:06 PM
Post: #1
Subscription NOTIFY parsing problem
ohNet can't parse the XML that JRiver Media Center sends in subscription NOTIFY messages for empty properties. Here's an example:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<e:propertyset xmlns:e="urn:schemas-upnp-org:event-1-0">
<e:property>
<CurrentConnectionIDs>0</CurrentConnectionIDs>
</e:property>
<e:property>
<SourceProtocolInfo/>
</e:property>
<e:property>
<SinkProtocolInfo>http-get:*:audio/L16;rate=22050;channels=1:DLNA.ORG_PN=LPCM</SinkProtocolInfo>
</e:property>
</e:propertyset>

The ohNet parsing code in EventSessionUpnp::ProcessNotification can't handle the line:

<SourceProtocolInfo/>

because it is expecting this to be sent as:

<SourceProtocolInfo></SourceProtocolInfo>

The UPnP Device Architecture 1.1 spec only mentions the second form, but it doesn't seem correct for a control point to reject the first form (an equivalent way of saying the same thing in XML). As evidence for this equivalence, ohNet is sending the first form for some values in device.xml (see DviProtocolUpnpDeviceXmlWriter::WriteTag) even though the UPnP Device Architecture 1.1 spec only mentions the second form for these values.

I am attaching a patch to EventUpnp.cpp to allow parsing the first form as well as the second form.


Attached File(s)
.zip  notify.zip (Size: 530 bytes / Downloads: 2)
Find all posts by this user
08-04-2014, 04:46 PM
Post: #2
RE: Subscription NOTIFY parsing problem
(06-04-2014 10:06 PM)simoncn Wrote:  ohNet can't parse the XML that JRiver Media Center sends in subscription NOTIFY messages for empty properties.

I am attaching a patch to EventUpnp.cpp to allow parsing the first form as well as the second form.

Thanks for diagnosing this. I'll try to get your patch submitted tomorrow.
Find all posts by this user
11-04-2014, 08:59 AM
Post: #3
RE: Subscription NOTIFY parsing problem
(08-04-2014 04:46 PM)simonc Wrote:  Thanks for diagnosing this. I'll try to get your patch submitted tomorrow.

I've downloaded the latest tag and confirmed that this is working OK. Many thanks!
Find all posts by this user


Forum Jump: