CHANGES IN CUPS V1.6.4
+ - Closed server connections were still not always detected
+ (<rdar://problem/14484313>)
- The libusb-based USB backend now loads its list of quirks from files
in /usr/share/cups/usb instead of using a hardcoded table
(<rdar://problem/14442769>)
* Same server, see if the connection is still established...
*/
- char ch; /* Connection check byte */
+ char ch; /* Connection check byte */
+ ssize_t n; /* Number of bytes */
#ifdef WIN32
- if (recv(cg->http->fd, &ch, 1, MSG_PEEK) < 0 &&
- WSAGetLastError() != WSAEWOULDBLOCK)
+ if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK)) == 0 ||
+ (n < 0 && WSAGetLastError() != WSAEWOULDBLOCK))
#else
- if (recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) < 0 &&
- errno != EWOULDBLOCK)
+ if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT)) == 0 ||
+ (n < 0 && errno != EWOULDBLOCK))
#endif /* WIN32 */
{
/*