From: "Albert Huang" <albert@csail.mit.edu>
To: "BlueZ development" <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] sdpd doesn't always collect non-persistent service records
Date: Thu, 12 Jun 2008 15:52:07 -0400 [thread overview]
Message-ID: <ef9938ec0806121252p17878962x186ef28e81b1a86c@mail.gmail.com> (raw)
[-- 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
next reply other threads:[~2008-06-12 19:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 19:52 Albert Huang [this message]
2008-06-23 1:12 ` [Bluez-devel] sdpd doesn't always collect non-persistent service records Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef9938ec0806121252p17878962x186ef28e81b1a86c@mail.gmail.com \
--to=albert@csail.mit.edu \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox