head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.05.01.17.54.09; author swiergot; state Exp; branches; next ; desc @@ 1.1 log @- Added numerous patches from the official CVS. @ text @--- jabberd/mio.c.orig 2002-02-08 08:39:27.000000000 +0100 +++ jabberd/mio.c 2003-05-01 19:44:32.000000000 +0200 @@@@ -501,11 +501,6 @@@@ bind(new->fd, (struct sockaddr*)&sa, sizeof(struct sockaddr_in)); } - /* set the socket to non-blocking */ - flags = fcntl(new->fd, F_GETFL, 0); - flags |= O_NONBLOCK; - fcntl(new->fd, F_SETFL, flags); - saddr = make_addr(cd->ip); if(saddr == NULL) { @@@@ -538,6 +533,11 @@@@ return; } + /* set the socket to non-blocking */ + flags = fcntl(new->fd, F_GETFL, 0); + flags |= O_NONBLOCK; + fcntl(new->fd, F_SETFL, flags); + /* XXX pthreads race condition.. cd->connected may be checked in the timeout, and cd freed before these calls */ /* set the default karma values */ @ .