* [Bluez-devel] sdpd doesn't always collect non-persistent service records
@ 2008-06-12 19:52 Albert Huang
2008-06-23 1:12 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Albert Huang @ 2008-06-12 19:52 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1: Type: text/plain, Size: 220 bytes --]
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
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 679 bytes --]
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);
[-- Attachment #3: Type: text/plain, Size: 247 bytes --]
-------------------------------------------------------------------------
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
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Bluez-devel] sdpd doesn't always collect non-persistent service records
2008-06-12 19:52 [Bluez-devel] sdpd doesn't always collect non-persistent service records Albert Huang
@ 2008-06-23 1:12 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2008-06-23 1:12 UTC (permalink / raw)
To: BlueZ development
Hi Albert,
> 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.
thanks for the patch. I had to simplify it a little bit, but I finally
got around in committing it.
Regards
Marcel
-------------------------------------------------------------------------
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-23 1:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-12 19:52 [Bluez-devel] sdpd doesn't always collect non-persistent service records Albert Huang
2008-06-23 1:12 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox