obexd: pbap: add headers correctly for size query

System Internals / BlueZ - Simon Fels [canonical.com] - 20 October 2015 06:05 UTC

When client queries for the size of a phonebook we fall into a indefinite loop as g_obex_apparam_encode always returns the same number of items added to the buffer regardless how often it is called. In former times where this code wasn't using GObexApparams a array was reduced each time the headers where added and so we could easily find out when we've added all headers. However today we need to solve this a bit differently by also setting the firstpacket flag when we receive the phonebook size result from the phonebook implementation which then lets us correctly go through without falling into a indefinite loop.

d75eb5c obexd: pbap: add headers correctly for size query
obexd/plugins/pbap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Upstream: git.kernel.org


  • Share