summaryrefslogtreecommitdiff
path: root/gobex/gobex.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2011-11-11 16:29:03 +0200
committerMarcel Holtmann <marcel@holtmann.org>2012-12-04 22:22:03 +0100
commit30b091c42e89d1b89fd1613b2038dac81f6e908a (patch)
treef10ecfe606db162cc516c74aa3cb3abcf8651b00 /gobex/gobex.c
parent648e66254271611596f6dd8c777e67e2e62fe1c2 (diff)
downloadbluez-30b091c42e89d1b89fd1613b2038dac81f6e908a.tar.gz
gobex: fix checking connection id for ABORT
OBEX spec state that it is optional to send a Connection Id header in an OBEX ABORT operation. Reported by Hendrik Sattler <post@hendrik-sattler.de>
Diffstat (limited to 'gobex/gobex.c')
-rw-r--r--gobex/gobex.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gobex/gobex.c b/gobex/gobex.c
index 86e1c4a02..b0f371640 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -705,9 +705,16 @@ static void handle_request(GObex *obex, GObexPacket *req)
op = g_obex_packet_get_operation(req, NULL);
- if (op == G_OBEX_OP_CONNECT)
+ switch (op) {
+ case G_OBEX_OP_CONNECT:
parse_connect_data(obex, req);
- else if (check_connid(obex, req) == FALSE) {
+ break;
+ case G_OBEX_OP_ABORT:
+ break;
+ default:
+ if (check_connid(obex, req))
+ break;
+
g_obex_debug(G_OBEX_DEBUG_ERROR, "Invalid Connection ID");
g_obex_send_rsp(obex, G_OBEX_RSP_SERVICE_UNAVAILABLE, NULL,
G_OBEX_HDR_INVALID);