]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/request.c
Merge changes from CUPS 1.7svn-r10861.
[thirdparty/cups.git] / cups / request.c
index c1fbb5a040885edb4114c8984150b26c5ec06c5e..4da103331af71b90cd010f5b05fe7322798a4f63 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   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
@@ -46,6 +46,9 @@
 #ifndef O_BINARY
 #  define O_BINARY 0
 #endif /* O_BINARY */
+#ifndef MSG_DONTWAIT
+#  define MSG_DONTWAIT 0
+#endif /* !MSG_DONTWAIT */
 
 
 /*
@@ -1015,8 +1018,13 @@ _cupsConnect(void)
 
       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...