Lines Matching refs:nfds
69 nfds, /* Number of file descriptors */
112 nfds = 0;
119 while (nfds > 0)
121 nfds --;
122 httpAddrClose(NULL, fds[nfds]);
128 if (addrlist && nfds < (int)(sizeof(fds) / sizeof(fds[0])))
136 if ((fds[nfds] = (int)socket(httpAddrFamily(&(addrlist->addr)), SOCK_STREAM, 0)) < 0)
154 setsockopt(fds[nfds], SOL_SOCKET, SO_REUSEADDR, CUPS_SOCAST &val, sizeof(val));
158 setsockopt(fds[nfds], SOL_SOCKET, SO_REUSEPORT, CUPS_SOCAST &val, sizeof(val));
163 setsockopt(fds[nfds], SOL_SOCKET, SO_NOSIGPIPE, CUPS_SOCAST &val, sizeof(val));
172 setsockopt(fds[nfds], IPPROTO_TCP, TCP_NODELAY, CUPS_SOCAST &val, sizeof(val));
179 fcntl(fds[nfds], F_SETFD, FD_CLOEXEC);
189 flags = fcntl(fds[nfds], F_GETFL, 0);
190 fcntl(fds[nfds], F_SETFL, flags | O_NONBLOCK);
197 if (!connect(fds[nfds], &(addrlist->addr.addr), (socklen_t)httpAddrLength(&(addrlist->addr))))
202 fcntl(fds[nfds], F_SETFL, flags);
205 *sock = fds[nfds];
207 while (nfds > 0)
209 nfds --;
210 httpAddrClose(NULL, fds[nfds]);
223 httpAddrClose(NULL, fds[nfds]);
229 fcntl(fds[nfds], F_SETFL, flags);
233 if (fds[nfds] > max_fd)
234 max_fd = fds[nfds];
237 addrs[nfds] = addrlist;
238 nfds ++;
242 if (!addrlist && nfds == 0)
262 while (nfds > 0)
264 nfds --;
265 httpAddrClose(NULL, fds[nfds]);
274 for (i = 0; i < nfds; i ++)
280 result = poll(pfds, (nfds_t)nfds, addrlist ? 100 : remaining > 250 ? 250 : remaining);
286 for (i = 0; i < nfds; i ++)
309 for (i = 0; i < nfds; i ++)
338 nfds --;
339 if (i < nfds)
341 memmove(fds + i, fds + i + 1, (size_t)(nfds - i) * (sizeof(fds[0])));
342 memmove(addrs + i, addrs + i + 1, (size_t)(nfds - i) * (sizeof(addrs[0])));
359 while (nfds > 0)
361 nfds --;
362 httpAddrClose(NULL, fds[nfds]);