---
lib/obex_client.c | 27 ++++++++++++++-------------
lib/obex_object.c | 8 --------
lib/obex_server.c | 21 ++++++++++++---------
3 files changed, 26 insertions(+), 30 deletions(-)
diff --git a/lib/obex_client.c b/lib/obex_client.c
index 0282886..9d07c29 100644
--- a/lib/obex_client.c
+++ b/lib/obex_client.c
@@ -338,21 +338,22 @@ static int obex_client_send(obex_t *self)
* PUT).
* No headeroffset needed because 'connect' is single
* packet (or we deny it). */
- ret = -1;
- if (self->object->opcode == OBEX_CMD_CONNECT)
- ret = obex_object_receive(self, msg);
- if (ret < 0) {
- obex_deliver_event(self, OBEX_EV_PARSEERR,
+ if (!self->object->abort) {
+ ret = -1;
+ if (self->object->opcode != OBEX_CMD_CONNECT)
+ ret = obex_object_receive(self, msg);
+ if (ret < 0) {
+ obex_deliver_event(self, OBEX_EV_PARSEERR,
self->object->opcode, 0, TRUE);
- self->mode = OBEX_MODE_SERVER;
- self->state = STATE_IDLE;
- return -1;
+ self->mode = OBEX_MODE_SERVER;
+ self->state = STATE_IDLE;
+ return -1;
+ }
+ /* Note : we may want to get rid of received header,
+ * however they are mixed with legitimate headers,
+ * and the user may expect to consult them later.
+ * So, leave them here (== overhead). */
}
-
- /* Note : we may want to get rid of received header,
- * however they are mixed with legitimate headers,
- * and the user may expect to consult them later.
- * So, leave them here (== overhead). */
}
obex_data_receive_finished(self);
diff --git a/lib/obex_object.c b/lib/obex_object.c
index 9f84862..00c75ee 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
@@ -609,9 +609,6 @@ int obex_object_finished(obex_t *self, obex_object_t
*object, int allowfinalcmd)
{
int finished = 0;
- if (object->abort)
- return 1;
-
if (object->suspend)
return 0;
@@ -762,11 +759,6 @@ static void obex_object_receive_stream(obex_t *self,
uint8_t hi,
DEBUG(4, "\n");
- if (object->abort) {
- DEBUG(3, "Ignoring incoming data because request was
aborted\n");
- return;
- }
-
/* Spare the app this empty nonlast body-hdr */
if (hi == OBEX_HDR_BODY && len == 0)
return;
diff --git a/lib/obex_server.c b/lib/obex_server.c
index 4b701ba..0995452 100644
--- a/lib/obex_server.c
+++ b/lib/obex_server.c
@@ -241,15 +241,18 @@ static int obex_server_send(obex_t *self)
* condition itself.
* No headeroffset needed because 'connect' is single packet (or
* we deny it). */
- ret = -1;
- if (cmd != OBEX_CMD_CONNECT)
- ret = obex_object_receive(self, msg);
- if (ret < 0)
- return obex_server_bad_request(self);
-
- /* Note: we may want to get rid of received header, however they
- * are mixed with legitimate headers, and the user may expect to
- * consult them later. So, leave them here (== overhead). */
+ if (!self->object->abort) {
+ ret = -1;
+ if (cmd != OBEX_CMD_CONNECT)
+ ret = obex_object_receive(self, msg);
+ if (ret < 0)
+ return obex_server_bad_request(self);
+
+ /* Note: we may want to get rid of received header,
+ * however they are mixed with legitimate headers, and
+ * the user may expect to consult them later. So, leave
+ * them here (== overhead). */
+ }
}
obex_data_receive_finished(self);
--
1.7.5.4
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users