GNOME Bugzilla – Bug 661988
Correct handling of containers w/ unknown child count
Last modified: 2012-07-17 06:49:06 UTC
+++ This bug was initially created as a clone of Bug #644491 +++ Currently we report the exact same child count as reported by MediaServer2 implementers, which is G_MAXUINT32 if child count in unknown. UPnP OTOH doesn't have the same semantics so most clients (if not all) will end-up browsing containers for ever.
Some questions: * In the MediaServer2 spec, in no place it is told that childcount=G_MAXUINT32 means "I don't really know how many children there are". I think this was just commented in bug #644491, but would be good to write it down in the spec. * I need to understand better what are the behaviour when a UPnP server tells a client there are 10 elements in a container, and then, when the client requests those 10 at the end it can only be returned less elements (just because, for instance, some user deleted some files meanwhile). What is the client behaviour? My understanding is that the client won't enter in a neverending loop, as this case, though not very common, can really happens.
(In reply to comment #1) > Some questions: > > > * In the MediaServer2 spec, in no place it is told that childcount=G_MAXUINT32 > means "I don't really know how many children there are". I think this was just > commented in bug #644491, but would be good to write it down in the spec. Will update, that idea just came up in the other bug and was never part of that spec initially. > > * I need to understand better what are the behaviour when a UPnP server tells a > client there are 10 elements in a container, and then, when the client requests > those 10 at the end it can only be returned less elements (just because, for > instance, some user deleted some files meanwhile). What is the client > behaviour? My understanding is that the client won't enter in a neverending > loop, as this case, though not very common, can really happens. That depends. Some clients might stop, others might try to get the exact number of children. Which is stupid, but kind of legal since the child count suggests that there are more.
Created attachment 208408 [details] [review] core: INT_MAX children means "Don't know"
Couple of comments: * The MediaServer2 spec should be updated if this is finally approved * Wouldn't be a good idea to clarify the value of INT_MAX? It's value can depend on the architecture, so clarifying it would be a good idea (i.e., INT32_MAX seems more clear than just INT_MAX).
Attachment 208408 [details] pushed as fd4648a - core: INT_MAX children means "Don't know"