]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix an edge case in cupsGetResponse so we don't accidentally write a 0-length chunk.
authorMichael R Sweet <msweet@msweet.org>
Mon, 27 Jan 2025 19:59:18 +0000 (14:59 -0500)
committerMichael R Sweet <msweet@msweet.org>
Mon, 27 Jan 2025 19:59:18 +0000 (14:59 -0500)
cups/request.c

index 0312aebe8578e71d61ade487b9edad55ba14a788..ab2c43fea1cf7fc8546b16d54b1112e447435475 100644 (file)
@@ -378,7 +378,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   * Check for an unfinished chunked request...
   */
 
-  if (http->data_encoding == HTTP_ENCODING_CHUNKED)
+  if (http->state == HTTP_STATE_POST_RECV && http->data_encoding == HTTP_ENCODING_CHUNKED)
   {
    /*
     * Send a 0-length chunk to finish off the request...