--- libfcgi/os_unix.c.orig 2002-03-05 19:14:49 UTC +++ libfcgi/os_unix.c @@ -42,6 +42,7 @@ static const char rcsid[] = "$Id: os_uni #include #include #include +#include #ifdef HAVE_NETDB_H #include @@ -103,6 +104,9 @@ static int volatile maxFd = -1; static int shutdownPending = FALSE; static int shutdownNow = FALSE; +static int libfcgiOsClosePollTimeout = 2000; +static int libfcgiIsAfUnixKeeperPollTimeout = 2000; + void OS_ShutdownPending() { shutdownPending = TRUE; @@ -168,6 +172,16 @@ int OS_LibInit(int stdioFds[3]) if(libInitialized) return 0; + char *libfcgiOsClosePollTimeoutStr = getenv( "LIBFCGI_OS_CLOSE_POLL_TIMEOUT" ); + if(libfcgiOsClosePollTimeoutStr) { + libfcgiOsClosePollTimeout = atoi(libfcgiOsClosePollTimeoutStr); + } + + char *libfcgiIsAfUnixKeeperPollTimeoutStr = getenv( "LIBFCGI_IS_AF_UNIX_KEEPER_POLL_TIMEOUT" ); + if(libfcgiIsAfUnixKeeperPollTimeoutStr) { + libfcgiIsAfUnixKeeperPollTimeout = atoi(libfcgiIsAfUnixKeeperPollTimeoutStr); + } + asyncIoTable = (AioInfo *)malloc(asyncIoTableSize * sizeof(AioInfo)); if(asyncIoTable == NULL) { errno = ENOMEM; @@ -755,19 +769,16 @@ int OS_Close(int fd) if (shutdown(fd, 1) == 0) { - struct timeval tv; - fd_set rfds; + struct pollfd pfd; int rv; char trash[1024]; - FD_ZERO(&rfds); + pfd.fd = fd; + pfd.events = POLLIN; do { - FD_SET(fd, &rfds); - tv.tv_sec = 2; - tv.tv_usec = 0; - rv = select(fd + 1, &rfds, NULL, NULL, &tv); + rv = poll(&pfd, 1, libfcgiOsClosePollTimeout); } while (rv > 0 && read(fd, trash, sizeof(trash)) > 0); } @@ -1116,13 +1127,11 @@ static int is_reasonable_accept_errno (c */ static int is_af_unix_keeper(const int fd) { - struct timeval tval = { READABLE_UNIX_FD_DROP_DEAD_TIMEVAL }; - fd_set read_fds; - - FD_ZERO(&read_fds); - FD_SET(fd, &read_fds); + struct pollfd pfd; + pfd.fd = fd; + pfd.events = POLLIN; - return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds); + return poll(&pfd, 1, libfcgiIsAfUnixKeeperPollTimeout) >= 0 && (pfd.revents & POLLIN); } /* on> FreeBSD Ports (https://github.com/freebsd/freebsd-ports)
aboutsummaryrefslogtreecommitdiffstats
blob: 934916bc9d0ef05efb7fddd25a83c95f6dbc0a1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
bin/gtk-gnutella
man/man1/gtk-gnutella.1.gz
share/appdata/gtk-gnutella.appdata.xml
share/applications/gtk-gnutella.desktop
%%DATADIR%%/%%ARCH%%-%%OPSYS%%/gtk-gnutella.nm
%%DATADIR%%/bogons.txt
%%DATADIR%%/el/FAQ
%%DATADIR%%/en/FAQ
%%DATADIR%%/en/glossary
%%DATADIR%%/favicon.png
%%DATADIR%%/fr/FAQ
%%DATADIR%%/fr/glossary
%%DATADIR%%/geo-ip.txt
%%DATADIR%%/geo-ipv6.txt
%%DATADIR%%/gwcache.boot
%%DATADIR%%/hostiles.txt
%%DATADIR%%/it/FAQ
%%DATADIR%%/it/glossary
%%DATADIR%%/ja/FAQ
%%DATADIR%%/pixmaps/arrow_down.xpm
%%DATADIR%%/pixmaps/arrow_up.xpm
%%DATADIR%%/pixmaps/booklib.xpm
%%DATADIR%%/pixmaps/booksha.xpm
%%DATADIR%%/pixmaps/bookshav.xpm
%%DATADIR%%/pixmaps/booktth.xpm
%%DATADIR%%/pixmaps/booktthv.xpm
%%DATADIR%%/pixmaps/chip.xpm
%%DATADIR%%/pixmaps/clanbomber_red.xpm
%%DATADIR%%/pixmaps/clanbomber_yellow.xpm
%%DATADIR%%/pixmaps/download.xpm
%%DATADIR%%/pixmaps/exit.xpm
%%DATADIR%%/pixmaps/filter.xpm
%%DATADIR%%/pixmaps/firewall.xpm
%%DATADIR%%/pixmaps/firewall_punchable.xpm
%%DATADIR%%/pixmaps/firewall_tcp.xpm
%%DATADIR%%/pixmaps/firewall_udp.xpm
%%DATADIR%%/pixmaps/firewall_udp_punchable.xpm
%%DATADIR%%/pixmaps/freeze.xpm
%%DATADIR%%/pixmaps/go_back.xpm
%%DATADIR%%/pixmaps/hungup.xpm
%%DATADIR%%/pixmaps/icon.16x16.xpm
%%DATADIR%%/pixmaps/icon.48x48.xpm
%%DATADIR%%/pixmaps/icon.xpm
%%DATADIR%%/pixmaps/leaf.xpm
%%DATADIR%%/pixmaps/legacy.xpm
%%DATADIR%%/pixmaps/magnet.16x16.png
%%DATADIR%%/pixmaps/magnet.32x32.png
%%DATADIR%%/pixmaps/magnet.64x64.png
%%DATADIR%%/pixmaps/natpmp.xpm
%%DATADIR%%/pixmaps/no_firewall.xpm
%%DATADIR%%/pixmaps/no_listening.xpm
%%DATADIR%%/pixmaps/offline.xpm
%%DATADIR%%/pixmaps/online.xpm
%%DATADIR%%/pixmaps/pause.xpm
%%DATADIR%%/pixmaps/save.xpm
%%DATADIR%%/pixmaps/smallserver.xpm
%%DATADIR%%/pixmaps/star-black.xpm
%%DATADIR%%/pixmaps/star-blue.xpm
%%DATADIR%%/pixmaps/star-green.xpm
%%DATADIR%%/pixmaps/star-red.xpm
%%DATADIR%%/pixmaps/star-violet.xpm
%%DATADIR%%/pixmaps/star-yellow.xpm
%%DATADIR%%/pixmaps/stock_form-time-field-16.xpm
%%DATADIR%%/pixmaps/thaw.xpm
%%DATADIR%%/pixmaps/ultra.xpm
%%DATADIR%%/pixmaps/upload-red.xpm
%%DATADIR%%/pixmaps/upload-yellow.xpm
%%DATADIR%%/pixmaps/upload.xpm
%%DATADIR%%/pixmaps/upnp-unusable.xpm
%%DATADIR%%/pixmaps/upnp.xpm
%%DATADIR%%/pixmaps/warning.xpm
%%DATADIR%%/robots.txt
%%DATADIR%%/spam.txt
%%DATADIR%%/spam_sha1.txt
%%DATADIR%%/tr/FAQ
%%DATADIR%%/tr/glossary
%%GUI%%share/icons/hicolor/128x128/apps/gtk-gnutella.png
%%GUI%%share/icons/hicolor/16x16/apps/gtk-gnutella.png
%%GUI%%share/icons/hicolor/256x256/apps/gtk-gnutella.png
%%GUI%%share/icons/hicolor/32x32/apps/gtk-gnutella.png
%%GUI%%share/icons/hicolor/512x512/apps/gtk-gnutella.png
%%GUI%%share/icons/hicolor/scalable/apps/gtk-gnutella.svg
%%NLS%%share/locale/de/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/el/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/es/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/fr/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/hu/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/it/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/ja/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/nb/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/nl/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/tr/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/uk/LC_MESSAGES/gtk-gnutella.mo
%%NLS%%share/locale/zh_CN/LC_MESSAGES/gtk-gnutella.mo
share/pixmaps/gtk-gnutella.png
share/pixmaps/gtk-gnutella.svg