]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/request.c
Fix more compiler warnings (Issue #5423)
[thirdparty/cups.git] / cups / request.c
index 924bb6fc008102b2b43a9bec2f039f0b2bd19a8f..69a7801375ade2a3a8eb8b16f92baf8fc3aa1bcf 100644 (file)
  */
 
 #include "cups-private.h"
+#include "debug-internal.h"
 #include <fcntl.h>
 #include <sys/stat.h>
-#if defined(WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__)
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* WIN32 || __EMX__ */
+#endif /* _WIN32 || __EMX__ */
 #ifndef O_BINARY
 #  define O_BINARY 0
 #endif /* O_BINARY */
@@ -150,11 +151,11 @@ cupsDoIORequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       return (NULL);
     }
 
-#ifdef WIN32
+#ifdef _WIN32
     if (fileinfo.st_mode & _S_IFDIR)
 #else
     if (S_ISDIR(fileinfo.st_mode))
-#endif /* WIN32 */
+#endif /* _WIN32 */
     {
      /*
       * Can't send a directory...
@@ -166,11 +167,11 @@ cupsDoIORequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       return (NULL);
     }
 
-#ifndef WIN32
+#ifndef _WIN32
     if (!S_ISREG(fileinfo.st_mode))
       length = 0;                      /* Chunk when piping */
     else
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
     length = ippLength(request) + (size_t)fileinfo.st_size;
   }
   else
@@ -209,9 +210,9 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       * Send the file with the request...
       */
 
-#ifndef WIN32
+#ifndef _WIN32
       if (S_ISREG(fileinfo.st_mode))
-#endif /* WIN32 */
+#endif /* _WIN32 */
       lseek(infile, 0, SEEK_SET);
 
       while ((bytes = read(infile, buffer, sizeof(buffer))) > 0)
@@ -686,16 +687,7 @@ cupsSendRequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
       * Update the Digest authentication string...
       */
 
-      if (http->nextnonce[0])
-      {
-        strlcpy(http->nonce, http->nextnonce, sizeof(http->nonce));
-        http->nonce_count = 1;
-        http->nextnonce[0] = '\0';
-      }
-      else
-        http->nonce_count ++;
-
-      _httpSetDigestAuthString(http, "POST", resource);
+      _httpSetDigestAuthString(http, http->nextnonce, "POST", resource);
     }
 
 #ifdef HAVE_GSSAPI
@@ -1031,13 +1023,13 @@ _cupsConnect(void)
       char     ch;                     /* Connection check byte */
       ssize_t  n;                      /* Number of bytes */
 
-#ifdef WIN32
+#ifdef _WIN32
       if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK)) == 0 ||
           (n < 0 && WSAGetLastError() != WSAEWOULDBLOCK))
 #else
       if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT)) == 0 ||
           (n < 0 && errno != EWOULDBLOCK))
-#endif /* WIN32 */
+#endif /* _WIN32 */
       {
        /*
         * Nope, close the connection...