From: wessels <> Date: Sat, 16 May 1998 00:57:42 +0000 (+0000) Subject: Stew Forster: X-Git-Tag: SQUID_3_0_PRE1~3315 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6444c4410d67d0570ec228a81ef4aaafe9672fcf;p=thirdparty%2Fsquid.git Stew Forster: Use close() instead of aioClose() if the socket as NONBLOCK set --- diff --git a/src/comm.cc b/src/comm.cc index 9336442657..bf7b7fd32e 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.255 1998/05/15 15:16:19 wessels Exp $ + * $Id: comm.cc,v 1.256 1998/05/15 18:57:42 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -664,6 +664,10 @@ void comm_close(int fd) { fde *F = NULL; +#if USE_ASYNC_IO + int flags; + int dummy = 0; +#endif debug(5, 5) ("comm_close: FD %d\n", fd); assert(fd >= 0); assert(fd < Squid_MaxFD); @@ -687,7 +691,13 @@ comm_close(int fd) */ close(fd); #elif USE_ASYNC_IO - aioClose(fd); + /* slf@connect.com.au */ + if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) + aioClose(fd); + else if (flags & SQUID_NONBLOCK) + close(fd); + else + aioClose(fd); #else close(fd); #endif