*
* IPP utilities for CUPS.
*
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
#ifndef O_BINARY
# define O_BINARY 0
#endif /* O_BINARY */
+#ifndef MSG_DONTWAIT
+# define MSG_DONTWAIT 0
+#endif /* !MSG_DONTWAIT */
/*
char ch; /* Connection check byte */
+#ifdef WIN32
+ if (recv(cg->http->fd, &ch, 1, MSG_PEEK) < 0 &&
+ WSAGetLastError() != WSAEWOULDBLOCK)
+#else
if (recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) < 0 &&
errno != EWOULDBLOCK)
+#endif /* WIN32 */
{
/*
* Nope, close the connection...