From e146105294665d636a55c1b66b0e607b2f0d2420 Mon Sep 17 00:00:00 2001 From: Michael Sweet Date: Tue, 29 Aug 2017 20:30:27 -0400 Subject: [PATCH] Always use chunking unless it is a simple request. --- cups/request.c | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/cups/request.c b/cups/request.c index f526bf016..322ca660e 100644 --- a/cups/request.c +++ b/cups/request.c @@ -144,45 +144,7 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP */ if (infile >= 0) - { - if (fstat(infile, &fileinfo)) - { - /* - * Can't get file information! - */ - - _cupsSetError(errno == EBADF ? IPP_STATUS_ERROR_NOT_FOUND : IPP_STATUS_ERROR_NOT_AUTHORIZED, - NULL, 0); - - ippDelete(request); - - return (NULL); - } - -#ifdef WIN32 - if (fileinfo.st_mode & _S_IFDIR) -#else - if (S_ISDIR(fileinfo.st_mode)) -#endif /* WIN32 */ - { - /* - * Can't send a directory... - */ - - ippDelete(request); - - _cupsSetError(IPP_STATUS_ERROR_NOT_POSSIBLE, strerror(EISDIR), 0); - - return (NULL); - } - -#ifndef WIN32 - if (!S_ISREG(fileinfo.st_mode)) - length = 0; /* Chunk when piping */ - else -#endif /* !WIN32 */ - length = ippLength(request) + (size_t)fileinfo.st_size; - } + length = 0; else length = ippLength(request); -- 2.39.5