After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770174 - gupnp_didl_lite_container_get_storage_used fails with minidlna
gupnp_didl_lite_container_get_storage_used fails with minidlna
Status: RESOLVED FIXED
Product: gupnp-av
Classification: Other
Component: General
0.12.x
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-20 18:38 UTC by Ivan Melnikov
Modified: 2019-02-22 05:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix parsing of storageUsed (2.19 KB, patch)
2018-02-13 21:10 UTC, Jens Georg
committed Details | Review

Description Ivan Melnikov 2016-08-20 18:38:25 UTC
The issue occurs with libgupnp-av-1.0-dev/stable 0.12.6-1 and MiniDLNA version 1.0.26

gupnp_didl_lite_container_get_storage_used fails on parsing Content Directory service info obtained from minidlna

Perhaps it is happened cause minidlna returns storageUsed = -1 explicitly.
In contrast with minidlna, the twonky server does not return storageUsed at all, and the issued function works properly for twonky.

Please see below the responses of both servers.


Minidlna response:

"<DIDL-Lite xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\" xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/\" xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\">\n<container id=\"0\" parentID=\"-1\" restricted=\"1\" childCount=\"4\" searchable=\"1\"><upnp:searchClass includeDerived=\"1\">object.item.audioItem</upnp:searchClass><upnp:searchClass includeDerived=\"1\">object.item.imageItem</upnp:searchClass><upnp:searchClass includeDerived=\"1\">object.item.videoItem</upnp:searchClass><dc:title>root</dc:title><upnp:class>object.container.storageFolder</upnp:class><upnp:storageUsed>-1</upnp:storageUsed></container></DIDL-Lite>"


Twonky response:

"<DIDL-Lite xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\" xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\" xmlns:arib=\"urn:schemas-arib-or-jp:elements-1-0/\" xmlns:dtcp=\"urn:schemas-dtcp-com:metadata-1-0/\" xmlns:pv=\"http://www.pv.com/pvns/\" xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/\"><container id=\"0\" parentID=\"-1\" restricted=\"1\" childCount=\"3\" searchable=\"1\" pv:persistentID=\"root\"><upnp:searchClass includeDerived=\"1\">object</upnp:searchClass><dc:title>root</dc:title><pv:childCountContainer>3</pv:childCountContainer><pv:modificationTime>1861</pv:modificationTime><upnp:class>object.container</upnp:class></container></DIDL-Lite>"
Comment 1 Jussi Kukkonen 2016-08-22 07:49:33 UTC
(In reply to Ivan from comment #0)
> gupnp_didl_lite_container_get_storage_used fails on parsing Content
> Directory service info obtained from minidlna

How does it fail?
Comment 2 Ivan Melnikov 2016-08-22 11:40:22 UTC
Program terminated with signal SIGSEGV, Segmentation fault.
  • #0 __GI_____strtoll_l_internal
    at ./strtol_l.c line 298
  • #1 __GI___strtoll_l
    at ./strtol_l.c line 556
  • #2 g_ascii_strtoll
    from /lib/i386-linux-gnu/libglib-2.0.so.0
  • #3 gupnp_didl_lite_container_get_storage_used
    from /usr/lib/libgupnp-av-1.0.so.2
  • #3 gupnp_didl_lite_container_get_storage_used
    at gupnp-didl-lite-container.c line 560
storage = <optimized out>
xml_node = 0x99467c8
str = <optimized out>
__FUNCTION__ = "gupnp_didl_lite_container_get_storage_used"
(gdb) print *xml_node
$1 = {_private = 0x0, type = XML_ELEMENT_NODE, name = 0x9946808 "storageUsed", children = 0x9946818, 
  last = 0x9946818, parent = 0x9945f20, next = 0x0, prev = 0x9946710, doc = 0x993f120, ns = 0x99413a0, 
  content = 0x0, properties = 0x0, nsDef = 0x0, psvi = 0x0, line = 0, extra = 0}
Comment 3 Jens Georg 2018-02-13 21:10:36 UTC
Created attachment 368327 [details] [review]
Fix parsing of storageUsed

For some reason, it was implemented as multi-valued property
Comment 4 Jens Georg 2018-02-13 21:11:21 UTC
Attachment 368327 [details] pushed as 4a89f75 - Fix parsing of storageUsed