Hello
I have revised the patch according to johan's comments. 
Please have a look.

---
>From 6bbe1b53c2dd4fcf5e2dc3fc37e400b193114967 Mon Sep 17 00:00:00 2001
From: Chen Congwu <congwu.c...@intel.com>
Date: Thu, 29 Oct 2009 17:02:52 +0800
Subject: [PATCH] obex_object_resume: fix the cmd code when delivering event for 
server case

At server side, it is sending response to client so the opcode is the
response code instead of the real cmd code. Should use cmd field instead.
While at client side, it is sending request to server so the cmd code
should use opcode.
---
 lib/obex_object.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/obex_object.c b/lib/obex_object.c
index 1073c97..732b3ba 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
@@ -911,6 +911,7 @@ int obex_object_suspend(obex_object_t *object)
 int obex_object_resume(obex_t *self, obex_object_t *object)
 {
        int ret;
+       uint8_t cmd;
 
        if (!object->suspend)
                return 0;
@@ -921,21 +922,22 @@ int obex_object_resume(obex_t *self, obex_object_t 
*object)
                return 0;
 
        ret = obex_object_send(self, object, TRUE, FALSE);
+       cmd = (self->state & MODE_SRV) ? object->cmd : object->opcode & 
~OBEX_FINAL;
 
        if (ret < 0) {
                obex_deliver_event(self, OBEX_EV_LINKERR,
-                                       object->opcode & ~OBEX_FINAL, 0, TRUE);
+                                       cmd, 0, TRUE);
                return -1;
        } else if (ret == 0) {
                obex_deliver_event(self, OBEX_EV_PROGRESS,
-                                       object->opcode & ~OBEX_FINAL, 0,
+                                       cmd, 0,
                                        FALSE);
                object->first_packet_sent = 1;
                object->continue_received = 0;
        } else {
                if (self->state & MODE_SRV) {
                        obex_deliver_event(self, OBEX_EV_REQDONE,
-                                               object->opcode & ~OBEX_FINAL,
+                                               cmd,
                                                0, TRUE);
                        self->state = MODE_SRV | STATE_IDLE;
                        return 0;
-- 
1.6.0.4

Best Regards,
Congwu

Attachment: 0001-obex_object_resume-fix-the-cmd-code-when-delivering.patch
Description: 0001-obex_object_resume-fix-the-cmd-code-when-delivering.patch

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to