From: max u. <ul...@gm...> - 2010-11-03 08:40:49
|
As far as I can figure out, an obex_t instance which makes a request (obex client) should never get into a state with MODE_SRV set. This breaks proper dispatching of events and so on. And so I assume that those MODE_SRV assignments in obex_client.c were some kind of mistake. The patch fixes it. --- lib/obex_client.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/obex_client.c b/lib/obex_client.c index 2ef636e..291cacf 100644 --- a/lib/obex_client.c +++ b/lib/obex_client.c @@ -88,7 +88,7 @@ int obex_client(obex_t *self, buf_t *msg, int final) * Jean II */ if (self->object->opcode == OBEX_CMD_CONNECT || obex_object_receive(self, msg) < 0) { - self->state = MODE_SRV | STATE_IDLE; + self->state = MODE_CLI | STATE_IDLE; obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE); return -1; } @@ -134,7 +134,7 @@ int obex_client(obex_t *self, buf_t *msg, int final) if (self->object->opcode == OBEX_CMD_CONNECT) { DEBUG(2, "We expect a connect-rsp\n"); if (obex_parse_connect_header(self, msg) < 0) { - self->state = MODE_SRV | STATE_IDLE; + self->state = MODE_CLI | STATE_IDLE; obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE); return -1; } @@ -149,7 +149,7 @@ int obex_client(obex_t *self, buf_t *msg, int final) /* Receive any headers */ if (obex_object_receive(self, msg) < 0) { - self->state = MODE_SRV | STATE_IDLE; + self->state = MODE_CLI | STATE_IDLE; obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE); return -1; } @@ -179,7 +179,7 @@ int obex_client(obex_t *self, buf_t *msg, int final) } else { /* Notify app that client-operation is done! */ DEBUG(3, "Done! Rsp=%02x!\n", rsp); - self->state = MODE_SRV | STATE_IDLE; + self->state = MODE_CLI | STATE_IDLE; if (self->object->abort) { if (rsp == OBEX_RSP_SUCCESS) obex_deliver_event(self, OBEX_EV_ABORT, self->object->opcode, rsp, TRUE); -- 1.7.1 |