Commit Diff


commit - 9e2d05155fd66ac528765af1d592aea55ba4fe78
commit + a0769bb1e683876bd26ba4c2cc83e3e35db8111f
blob - b9e126395c419d439c968c0b1b113ab6e1a26b37
blob + a62f4f48f936f8cb6c39475cec6af2804c62e233
--- libexec/got-fetch-http/got-fetch-http.c
+++ libexec/got-fetch-http/got-fetch-http.c
@@ -276,12 +276,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) {