sdpd doesn't always collect non-persistent service records

"Albert Huang" <[email protected]>
Newsgroups gmane.linux.bluez.devel
Message-ID <[email protected]>
Hi,

When using the libbluetooth SDP API, records registered that do not
have SDP_RECORD_PERSIST are not always collected by sdpd when the sdp
session is closed.  I think the attached patch should help.

Regards,
Albert

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
patch.txt (text/plain, 679 B)
Index: server.c
===================================================================
RCS file: /cvsroot/bluez/utils/sdpd/server.c,v
retrieving revision 1.13
diff -u -r1.13 server.c
--- server.c	2 Feb 2008 03:37:48 -0000	1.13
+++ server.c	12 Jun 2008 19:47:52 -0000
@@ -151,11 +151,15 @@
 	uint8_t *buf;
 	int sk, len, size;
 
-	if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL))
-		return FALSE;
-
 	sk = g_io_channel_unix_get_fd(chan);
 
+	if (cond & G_IO_NVAL) {
+		return FALSE;
+	} else if (cond & (G_IO_HUP | G_IO_ERR)) {
+		sdp_svcdb_collect_all(sk);
+		return FALSE;
+	}
+
 	len = recv(sk, &hdr, sizeof(sdp_pdu_hdr_t), MSG_PEEK);
 	if (len <= 0) {
 		sdp_svcdb_collect_all(sk);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.