bug in os_unix.c with TCP/IP. deadlock read after accept on 'dead' connection
Evgeniy Pirogov <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
The problem described in the comments /********************************************************************** * This works around a problem on Linux 2.0.x and SCO Unixware (maybe * others?). When a connect() is made to a Unix Domain socket, but its * not accept()ed before the web server gets impatient and close()s, an * accept() results in a valid file descriptor, but no data to read. * This causes a block on the first read() - which never returns! * .... happening with TCP/IP sockets as well on Linux 2.4.17 and 2.6.10 sanity check performed by static int is_af_unix_keeper must be applied to AF_INET sockets as well in OS_Accept a patch attached E.Pirogov Team Leader OpenSRS Development +1.416-535-0123x1392 ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/
patch.txt
(text/plain, 370 B)
--- /u/blogware_src/fcgi-2.4.0/libfcgi/os_unix.c Mon Feb 21 11:26:05 2005
+++ os_unix.c Mon Aug 15 10:04:40 2005
@@ -1205,7 +1205,7 @@
if (ReleaseLock(listen_sock))
return (-1);
- if (sa.in.sin_family != AF_UNIX || is_af_unix_keeper(socket))
+ if (is_af_unix_keeper(socket))
break;
close(socket);