[PATCH] Fix cache is invalid on empty listing response

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix cache marked as invalid when no data available in response to get phone
book listing. This fixes obexd crash in 3-way calling scenario. Cache is
created when there is second incoming call. If the call is rejected and
retried again, valid empty cache is sent over obex stream that causes obexd
crash. With this fix, the stream is aborted in such scenario. A new attempt
to create cache is carried out on each new subsequent incoming call.
---
 plugins/pbap.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/plugins/pbap.c b/plugins/pbap.c
index 11cb678..f7f3897 100644
--- a/plugins/pbap.c
+++ b/plugins/pbap.c
@@ -407,7 +407,11 @@ static void cache_ready_notify(void *user_data)
 			(const char *) pbap->params->searchval);
 
 	if (sorted == NULL) {
-		pbap->cache.valid = TRUE;
+		/* When no data available from tracker, cache marked as
+		 * invalid (new one will be tried to be created next time),
+		 * no such file or directory error is set, and obex stream
+		 * is aborted */
+		pbap->cache.valid = FALSE;
 		obex_object_set_io_flags(pbap, G_IO_ERR, -ENOENT);
 		return;
 	}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux