Hi Johan, > I have been working on an OBEX Object Push server implementation, which > allows the user to interactively allow or deny an incoming PUT request. > The server-side user should be provided with as much as possible > information about the incomming request, including information in > potential name and type headers in the first PUT packet. > > The current openobex server implementation is done so that OBEX_EV_REQ > for the put is signaled to the user only after all packets have been > received. There is the OBEX_EV_REQHINT which is intended for performing > early denying of the request, but there are two problems with it: > > 1. It only works for single packet requests. The state machine in > obex_server.c will break if the response is set to something else than > SUCCESS or CONTINUE for a packet which is not the final one. > 2. The headers for the first packet have not yet been parsed by openobex > when REQHINT is signaled, so there is no way for the user application to > access them. > > While thinking about this problem several solutions came to my mind. The > first one was to move REQHINT further down in the obex_server function > after the headers have been parsed. This however will not work since one > of the purposes of REQHINT is to allow the user callback to set the > headeroffset (in case of some special extension of OBEX), i.e. REQHINT > *must* be called before the header parsing. > > The second idea was to send REQHINT a second time after header parsing, > but this is also not good since it would break any application which > expects to get only one REQHINT for each request. > > So, the solution I ended up with was to add a completely new event which > the user callback can use for checking the headers in the first packet > and then deny the request if needed. I didn't come up with a better name > than OBEX_EV_REQCHECK, so if you have a better idea, feel free to rename > it :-) > > Another thing which the patch fixes is that it allows the server to deny > the request also between the first and last packets (which is something > that could be useful e.g. if the server runs out of diskspace or if the > user presses a "cancel" button) by setting the response in the > OBEX_EV_PROGRESS callback.
since nobody actually complained about your patch, I took it and applied it to the CVS. I think we are ready. Christian, how should the library version be changed for our next release. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Openobex-users mailing list [email protected] http://lists.sourceforge.net/lists/listinfo/openobex-users
