From: Brett Gordon Date: Sat, 11 Nov 2017 20:26:44 +0000 (-0500) Subject: htget: dump rest of lines buffer before main content xfer X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8623faab7c5470c392a39ebfae0f7f384645bfe0;p=FUZIX.git htget: dump rest of lines buffer before main content xfer --- diff --git a/Applications/netd/htget.c b/Applications/netd/htget.c index 14aa19a5..6e40a436 100644 --- a/Applications/netd/htget.c +++ b/Applications/netd/htget.c @@ -185,6 +185,10 @@ int main(int argc, char *argv[]) /* FIXME: if we saw a Transfer-Encoding: chunked" we need to do this bit differently */ if (code == 200) { + if (write(of, readp, bufend - readp) < 0){ + perror("write"); + exit(1); + } while((len = xread()) > 0) { if (write(of, buf, len) != len) { perror("write");