obexd/client: Fix calling g_obex_cancel_req for completed requests
Luiz Augusto von Dentz
maintainerPATCH 1/2 obexd/client: Fix calling g_obex_cancel_req for completed requests
From: Luiz Augusto von Dentz <[email protected]>
This leads to incorrect responses such as the following:
Quoted 1 line
ACL data: handle 12 flags
0x02dlen 26
L2CAP(d): cid 0x0041 len 22 [psm 3]
RFCOMM(d): UIH: cr 0 dlci 38 pf 0 ilen 18 fcs 0xfd
OBEX: Get rsp(f): status 200 len 18
Status 200 = Success
Connection ID (0xcb) = 1
App. Parameters (0x4c) = Sequence length 4
End of Body (0x49) = Sequence length 0
< ACL data: handle 12 flags 0x00 dlen 11
L2CAP(d): cid 0x0040 len 7 [psm 3]
RFCOMM(d): UIH: cr 1 dlci 38 pf 0 ilen 3 fcs 0x27
OBEX: Get rsp(f): status 715 len 3
---
obexd/client/transfer.c | 1 +
1 file changed, 1 insertion(+)obexd/client/transfer.c +1 -0
@@ -698,6 +698,7 @@ static void get_xfer_progress_first(GObex *obex, GError *err, GObexPacket *rsp, }if (rspcode ==G_OBEX_RSP_SUCCESS ) { + transfer->req =0 ;xfer_complete (obex, err, transfer);return ; }
Signature · 1 line
1.9.0
Luiz Augusto von Dentz
maintainerPATCH 2/2 gobex: Fix being able to cancel completed requests
From: Luiz Augusto von Dentz <[email protected]>
This fixes bogus responses when rsp_func calls g_obex_cancel_req for responses with final bit set.
--- gobex/gobex.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
gobex/gobex.c +5 -3
@@ -1098,6 +1098,10 @@ static void handle_response(GObex *obex, GError *err, GObexPacket *rsp) p = obex->pending_req; +/* Reset if final so it can no longer be cancelled */ +if (final_rsp) + obex->pending_req =NULL ; +if (p->cancelled) err =g_error_new (G_OBEX_ERROR ,G_OBEX_ERROR_CANCELLED ,"The operation was cancelled" );
@@ -1116,10 +1120,8 @@ static void handle_response(GObex *obex, GError *err, GObexPacket *rsp)if (p->cancelled)g_error_free (err); -if (final_rsp) { +if (final_rsp)pending_pkt_free (p); - obex->pending_req =NULL ; - }if (!disconn &&g_queue_get_length (obex->tx_queue) >0 )enable_tx (obex);
Signature · 1 line
1.9.0
Luiz Augusto von Dentz
maintainerHi,
Quoted 33 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
This leads to incorrect responses such as the following:
Quoted 1 line
ACL data: handle 12 flags
0x02dlen 26L2CAP(d): cid 0x0041 len 22 [psm 3] RFCOMM(d): UIH: cr 0 dlci 38 pf 0 ilen 18 fcs 0xfd OBEX: Get rsp(f): status 200 len 18 Status 200 = Success Connection ID (0xcb) = 1 App. Parameters (0x4c) = Sequence length 4 End of Body (0x49) = Sequence length 0 < ACL data: handle 12 flags 0x00 dlen 11 L2CAP(d): cid 0x0040 len 7 [psm 3] RFCOMM(d): UIH: cr 1 dlci 38 pf 0 ilen 3 fcs 0x27 OBEX: Get rsp(f): status 715 len 3 --- obexd/client/transfer.c | 1 + 1 file changed, 1 insertion(+)obexd/client/transfer.c +1
-1@@ -698,6 +698,7 @@ static void get_xfer_progress_first(GObex *obex, GError *err, GObexPacket *rsp, }if (rspcode ==G_OBEX_RSP_SUCCESS ) { + transfer->req =0 ;xfer_complete (obex, err, transfer);return ; } --
Quoted 1 line
1.9.0
Pushed.
Signature · 1 line
Luiz Augusto von Dentz