# HG changeset patch # User Daniel Atallah # Date 1218582545 0 # Node ID 7f401e99f9d93228fc0a90850231e328a956c8ae # Parent 0dd3df3650177b7f0695f4ae712624dd806eeac0 Use non-blocking io for inbound TCP connections for SIMPLE. diff -r 0dd3df365017 -r 7f401e99f9d9 libpurple/protocols/simple/simple.c --- 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);