summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-20 18:59:41 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-21 16:13:44 +0200
commit0246b2d6bdd7f666dca548a37d9bd235056fbf74 (patch)
tree21f5e6afe733d07ecfab6574761224ac7c12f1f4
parent4b873ec8af81415a1c501aa1a9024146d78cd222 (diff)
downloadbluez-0246b2d6bdd7f666dca548a37d9bd235056fbf74.tar.gz
gobex/transfer: Keep request id for GET when SRM is active
In case a GET operation is in progress with SRM the same request id is valid for the whole transfer otherwise it is not possible to cancel the transfer after the first response.
-rw-r--r--gobex/gobex-transfer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gobex/gobex-transfer.c b/gobex/gobex-transfer.c
index 09f56ba21..84981778a 100644
--- a/gobex/gobex-transfer.c
+++ b/gobex/gobex-transfer.c
@@ -195,9 +195,11 @@ static void transfer_response(GObex *obex, GError *err, GObexPacket *rsp,
struct transfer *transfer = user_data;
GObexPacket *req;
gboolean rspcode, final;
+ guint id;
g_obex_debug(G_OBEX_DEBUG_TRANSFER, "transfer %u", transfer->id);
+ id = transfer->req_id;
transfer->req_id = 0;
if (err != NULL) {
@@ -230,8 +232,11 @@ static void transfer_response(GObex *obex, GError *err, GObexPacket *rsp,
} else if (!g_obex_srm_active(transfer->obex)) {
req = g_obex_packet_new(transfer->opcode, TRUE,
G_OBEX_HDR_INVALID);
- } else
+ } else {
+ /* Keep id since request still outstanting */
+ transfer->req_id = id;
return;
+ }
transfer->req_id = g_obex_send_req(obex, req, -1, transfer_response,
transfer, &err);