Zitat von "Luiz Augusto von Dentz" <luiz.de...@gmail.com>: > From: Luiz Augusto von Dentz <luiz.dentz-...@nokia.com> > > Also deliver ABORT signal so the user application can free whatever > resource being use to handle the request. > --- > lib/obex_main.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/lib/obex_main.c b/lib/obex_main.c > index 0a72c14..5f1f6e6 100644 > --- a/lib/obex_main.c > +++ b/lib/obex_main.c > @@ -378,6 +378,13 @@ int obex_cancelrequest(obex_t *self, int nice) > > obex_object_delete(object); > > + if (self->mode == MODE_SRV) { > + self->state = STATE_IDLE; > + obex_deliver_event(self, OBEX_EV_ABORT, > + self->object->opcode, 0, TRUE);
I know that most obex_deliver_event() calls are not correct when they signal errors (like above your changed lines in the very same function) but let's try not to instroduce additional ones :-) self->object->opcode contains the response code at this point, most likely. You want to use obex_object_getcmd(); you need to make it global (non-static) first, though. Why is this event only sent for a server, anyway? For the "!nice" part we send it unconditionally, obex_object_getcmd() will give you the right one for server and client. > + return 0; > + } > + > self->object->abort = TRUE; > self->state = STATE_REC; > Additionally, you can spare the "return 0" by moving the next two statements into the "else" case. HS ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Openobex-users mailing list Openobex-users@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/openobex-users