Am Freitag 05 März 2010 17:35:07 schrieb Bastien Nocera: > On Sun, 2010-02-21 at 16:45 +0100, Hendrik Sattler wrote: > <snip> > > > > > Additionally to setting self->fd here, you should also modify > > > > obex_transport_handle_input() to no choose the special USB path when > > > > self->fd is valid. > > > > > > Except that it doesn't work because it doesn't actually select on > > > self->fd, but on self->fd+1. > > > > > > ret = select((int)highestfd+1, &fdset, NULL, NULL, &time); > > > > > > I'm pretty sure that's not correct for our case. > > > > The select call is correct. The change in obex_transport_handle_input() > > can be an additional patch. > > You seem to have committed this patch despite my comments, which breaks > osso-gwobex's USB support, as well as obex_test's USB support when built > with libusb1.
You didn't react on my comment that your comment was plain wrong. We don't do call select() on fd+1. However, it may be that the POLLIN fd is not usuable with select()? The following code adds it to the FD_SET: FD_ZERO(&fdset); if (self->fd != INVALID_SOCKET) { FD_SET(self->fd, &fdset); if (self->fd > highestfd) highestfd = self->fd; } And the +1 in the select() call is correct but does not affect the self->fd. In what way does it break for you? (try looking with strace) > The select call is correct when the ->fd is the output file descriptor, > which it isn't for USB. You mean the output file descriptor is for _reading_? The above select() call watches for readable data, not writable, so POLLIN should be the right fd for that, isn't it? > So either the select call needs to be modified, or the patch needs to be > reverted. If the select() on the POLLIN fd does really not work for you, then we'll revert it. It would be nice to see the strace'd select() call first. HS PS: sorry, I don't have a USB OBEX device. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Openobex-users mailing list Openobex-users@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/openobex-users