not-yet-connected sockets?
Ove Kaaven
ovehk at ping.uio.no
Sat Aug 18 11:05:40 CDT 2001
On Sat, 18 Aug 2001, Daniel Walker wrote:
> Ove Kaaven wrote:
> >
> > On Fri, 17 Aug 2001, Daniel Walker wrote:
> >
> > > This fixes the problem that I'm seeing .. Any version of Bearshare seem
> > > to be effected ..
> >
> > Well, this is not a correct patch of course (but you probably already knew
> > that), but if this fixes something, I'd like to know what and why, as
> > sock_reselect should never do a poll() unless sock->state is set, and
> > sock->state should (in theory) not be set before a connect() or listen()
> > is done on the socket. Do a --debugmsg +server,+winsock, please?
>
> From the trace it looks like sock->state is set the WD_FD_NONBLOCKING .
> enable_socket_event() set's the sock->state to non-blocking then calls
> sock_reselect.
Aha. Then you'd probably want something like this, then?
Index: server/sock.c
===================================================================
RCS file: /home/wine/wine/server/sock.c,v
retrieving revision 1.18
diff -u -r1.18 sock.c
--- server/sock.c 2001/05/14 20:09:39 1.18
+++ server/sock.c 2001/08/18 15:00:53
@@ -84,7 +84,7 @@
if (sock->obj.select == -1) {
/* previously unconnected socket, is this reselect supposed to connect it? */
- if (!sock->state) return;
+ if (!(sock->state & ~WS_FD_NONBLOCKING)) return;
/* ok, it is, attach it to the wineserver's main poll loop */
add_select_user( &sock->obj );
}
More information about the wine-devel
mailing list