[PATCH obexd 10/12 v3] gobex: fix not tracking received responses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

obex->rx_last_op is only updated if there is no pending request which
means it only store last received request.
---
 gobex/gobex.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gobex/gobex.c b/gobex/gobex.c
index b0f3716..e2d9c6c 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -860,19 +860,20 @@ static gboolean incoming_data(GIOChannel *io, GIOCondition cond,
 	if (obex->rx_data < 3 || obex->rx_data < obex->rx_pkt_len)
 		return TRUE;
 
+	obex->rx_last_op = obex->rx_buf[0] & ~FINAL_BIT;
+
 	if (obex->pending_req) {
 		struct pending_pkt *p = obex->pending_req;
 		opcode = g_obex_packet_get_operation(p->pkt, NULL);
 		header_offset = rsp_header_offset(opcode);
 	} else {
-		opcode = obex->rx_buf[0] & ~FINAL_BIT;
+		opcode = obex->rx_last_op;
 		/* Unexpected response -- fail silently */
 		if (opcode > 0x1f && opcode < 0xff) {
 			obex->rx_data = 0;
 			return TRUE;
 		}
 		header_offset = req_header_offset(opcode);
-		obex->rx_last_op = opcode;
 	}
 
 	if (header_offset < 0) {
-- 
1.7.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux