summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2006-09-11 22:03:38 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2006-09-11 22:03:38 +0000
commitc52c0f01ba210aa967660799d86cb4402ee13614 (patch)
tree2700eefd798b53110005eae590e4c2c80750dee3
parent4c47e772dbded0a7fe9d77346291bf24e2e07100 (diff)
added verification for protocol error and I/O error
-rw-r--r--hcid/dbus-sdp.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/hcid/dbus-sdp.c b/hcid/dbus-sdp.c
index 4f23424e..b9a36460 100644
--- a/hcid/dbus-sdp.c
+++ b/hcid/dbus-sdp.c
@@ -485,6 +485,20 @@ static void remote_svc_rec_completed_cb(uint8_t type, uint16_t err, uint8_t *rsp
if (!ctxt)
return;
+ if (err == 0xffff) {
+ /* Check for protocol error or I/O error */
+ int sdp_err = sdp_get_error(ctxt->session);
+ if (sdp_err < 0) {
+ error("search failed: Invalid session!");
+ error_failed(ctxt->conn, ctxt->rq, EINVAL);
+ return;
+ }
+
+ error("search failed :%s (%d)", strerror(sdp_err), sdp_err);
+ error_failed(ctxt->conn, ctxt->rq, sdp_err);
+ return;
+ }
+
if (type == SDP_ERROR_RSP) {
error_sdp_failed(ctxt->conn, ctxt->rq, err);
return;
@@ -544,6 +558,20 @@ static void remote_svc_handles_completed_cb(uint8_t type, uint16_t err, uint8_t
if (!ctxt)
return;
+ if (err == 0xffff) {
+ /* Check for protocol error or I/O error */
+ int sdp_err = sdp_get_error(ctxt->session);
+ if (sdp_err < 0) {
+ error("search failed: Invalid session!");
+ error_failed(ctxt->conn, ctxt->rq, EINVAL);
+ return;
+ }
+
+ error("search failed :%s (%d)", strerror(sdp_err), sdp_err);
+ error_failed(ctxt->conn, ctxt->rq, sdp_err);
+ return;
+ }
+
if (type == SDP_ERROR_RSP) {
error_sdp_failed(ctxt->conn, ctxt->rq, err);
return;
@@ -622,6 +650,20 @@ static void search_completed_cb(uint8_t type, uint16_t err, uint8_t *rsp, size_t
if (!ctxt)
return;
+ if (err == 0xffff) {
+ /* Check for protocol error or I/O error */
+ int sdp_err = sdp_get_error(ctxt->session);
+ if (sdp_err < 0) {
+ error("search failed: Invalid session!");
+ error_failed(ctxt->conn, ctxt->rq, EINVAL);
+ return;
+ }
+
+ error("search failed :%s (%d)", strerror(sdp_err), sdp_err);
+ error_failed(ctxt->conn, ctxt->rq, sdp_err);
+ return;
+ }
+
if (type == SDP_ERROR_RSP) {
error_sdp_failed(ctxt->conn, ctxt->rq, err);
return;