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