summaryrefslogtreecommitdiff
path: root/obexd/plugins
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-04-21 20:24:58 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-04-23 23:12:34 +0300
commitf3cc176594b51d4ff3aa96c0246a75c0e87e4cbc (patch)
tree67ab1063d2d7fa49cf2c187443826bde4d2d9b94 /obexd/plugins
parent07943b87fac629db2c58281ea1d6e0faad6a2965 (diff)
downloadbluez-f3cc176594b51d4ff3aa96c0246a75c0e87e4cbc.tar.gz
obexd/pbap: Fix hanging when maxlistcount = 0
vobject_list_get_next_header shall only attempt to call g_obex_apparam_encode otherwise it will just keep adding the same tag in a loop.
Diffstat (limited to 'obexd/plugins')
-rw-r--r--obexd/plugins/pbap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c
index ad9320876..d5a3046ae 100644
--- a/obexd/plugins/pbap.c
+++ b/obexd/plugins/pbap.c
@@ -369,6 +369,7 @@ static int generate_response(void *user_data)
/* Ignore all other parameter and return PhoneBookSize */
uint16_t size = g_slist_length(pbap->cache.entries);
+ pbap->obj->firstpacket = TRUE;
pbap->obj->apparam = g_obex_apparam_set_uint16(
pbap->obj->apparam,
PHONEBOOKSIZE_TAG,
@@ -892,8 +893,10 @@ static ssize_t vobject_list_get_next_header(void *object, void *buf, size_t mtu,
*hi = G_OBEX_HDR_APPARAM;
- if (pbap->params->maxlistcount == 0)
+ if (obj->firstpacket) {
+ obj->firstpacket = FALSE;
return g_obex_apparam_encode(obj->apparam, buf, mtu);
+ }
return 0;
}