choosing them for draft, normal, and best quality modes (Issue #5091)
- Fixed the localization unit test on Linux (Issue #5097)
- The CUPS library did not reuse domain sockets (Issue #5098)
+- `httpAddrConnect` leaked sockets in certain circumstances, causing some
+ printers to hang (rdar://31965686)
- Fixed an issue with Chinese localizations on macOS (rdar://32419311)
- The IPP backend now always sends the "finishings" attribute for printers that
support it because otherwise the client cannot override printer defaults
int flags; /* Socket flags */
#endif /* !WIN32 */
int remaining; /* Remaining timeout */
- int i, /* Looping var */
+ int i, j, /* Looping vars */
nfds, /* Number of file descriptors */
fds[100], /* Socket file descriptors */
result; /* Result from select() or poll() */
if (!getpeername(fds[i], (struct sockaddr *)&peer, &len))
DEBUG_printf(("1httpAddrConnect2: Connected to %s:%d...", httpAddrString(&peer, temp, sizeof(temp)), httpAddrPort(&peer)));
# endif /* DEBUG */
+
+ break;
}
# ifdef HAVE_POLL
else if (pfds[i].revents & (POLLERR | POLLHUP))
}
if (connaddr)
+ {
+ /*
+ * Connected on one address, close all of the other sockets we have so
+ * far and return...
+ */
+
+ for (j = 0; j < i; j ++)
+ httpAddrClose(NULL, fds[j]);
+
+ for (j ++; j < nfds; j ++)
+ httpAddrClose(NULL, fds[j]);
+
return (connaddr);
+ }
}
#endif /* O_NONBLOCK */