Mercurial > pidgin.yaz
diff libpurple/protocols/simple/simple.c @ 23771:7f401e99f9d9
Use non-blocking io for inbound TCP connections for SIMPLE.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 12 Aug 2008 23:09:05 +0000 |
parents | 6b09c40a15d1 |
children | 16734635febf 61f825f8b3a2 e22bcca9f2b2 |
line wrap: on
line diff
--- a/libpurple/protocols/simple/simple.c Tue Aug 12 23:03:31 2008 +0000 +++ b/libpurple/protocols/simple/simple.c Tue Aug 12 23:09:05 2008 +0000 @@ -1703,8 +1703,15 @@ PurpleConnection *gc = data; struct simple_account_data *sip = gc->proto_data; struct sip_connection *conn; + int newfd, flags; - int newfd = accept(source, NULL, NULL); + newfd = accept(source, NULL, NULL); + + flags = fcntl(newfd, F_GETFL); + fcntl(newfd, F_SETFL, flags | O_NONBLOCK); +#ifndef _WIN32 + fcntl(newfd, F_SETFD, FD_CLOEXEC); +#endif conn = connection_create(sip, newfd);