]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Stew Forster:
authorwessels <>
Sat, 16 May 1998 00:57:42 +0000 (00:57 +0000)
committerwessels <>
Sat, 16 May 1998 00:57:42 +0000 (00:57 +0000)
Use close() instead of aioClose() if the socket as NONBLOCK set

src/comm.cc

index 93364426571449a8a42d3ef986e2686e661b6a60..bf7b7fd32ea57b6d5676f2f791e3d16e8cfdf812 100644 (file)
@@ -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