commit 797e49084be5d4629f44fb3bf8dc29eb079a112a from: Stefan Sperling via: Thomas Adam date: Fri Apr 26 22:40:30 2024 UTC fix got-fetch-http when chunked encoding is not used We would end up raising a spurious error when the server had no more data to send and would abort the clone operation, while everything was fine in fact. Problem reported by vazub via IRC, thanks! commit - 62e037f1de942562a70addbbb4695c524f660160 commit + 797e49084be5d4629f44fb3bf8dc29eb079a112a blob - edb421692ffb577d98757f503dd42c68c7717128 blob + 43858a3fc70b77963b5985f1bf6470bb24429296 --- libexec/got-fetch-http/got-fetch-http.c +++ libexec/got-fetch-http/got-fetch-http.c @@ -278,12 +278,8 @@ http_read(struct bufio *bio, int chunked, size_t *chun size_t r; ssize_t ret = 0, linelen; - if (!chunked) { - r = bufio_drain_sync(bio, buf, bufsz); - if (r == 0) - return -1; - return r; - } + if (!chunked) + return bufio_drain_sync(bio, buf, bufsz); while (bufsz > 0) { if (*chunksz == 0) {