From bdb0cdaeb4c90c8233d61289cebe1d792744c73f Mon Sep 17 00:00:00 2001
From: Jakub Adamek <adamek.kuba@gmail.com>
Date: Tue, 19 Jul 2011 00:08:52 +0200
Subject: [PATCH] Fix improper handling of CONTINUE.

Some profiles (BIP) put CONTINUE in a final response packet.
---
 lib/obex_client.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/obex_client.c b/lib/obex_client.c
index 5107d62..4a845e8 100644
--- a/lib/obex_client.c
+++ b/lib/obex_client.c
@@ -49,7 +49,7 @@ static __inline uint16_t msg_get_len(const buf_t *msg)
 		return 0;
 }
 
-static int obex_client_recv(obex_t *self, buf_t *msg, int rsp)
+static int obex_client_recv(obex_t *self, buf_t *msg, int rsp, int final)
 {
 	int ret;
 
@@ -90,7 +90,7 @@ static int obex_client_recv(obex_t *self, buf_t *msg, int rsp)
 	}
 
 	/* Are we done yet? */
-	if (rsp == OBEX_RSP_CONTINUE) {
+	if (!final) {
 		DEBUG(3, "Continue...\n");
 
 		self->object->continue_received = 1;
@@ -249,7 +249,7 @@ int obex_client(obex_t *self, buf_t *msg, int final)
 		return obex_client_send(self, msg, rsp);
 
 	case STATE_REC:
-		return obex_client_recv(self, msg, rsp);
+		return obex_client_recv(self, msg, rsp, final);
 
 	default:
 		DEBUG(0, "Unknown state\n");
-- 
1.7.0.4

