commit f1d0a69863bb9f6c8234a52c4229fc5debe0a82f from: Stefan Sperling via: Thomas Adam date: Thu Apr 25 14:57:36 2024 UTC revert my previous two commits because they broke clone over http commit - 3b4ee51b0d8c37b85d25bd460969065466b58838 commit + f1d0a69863bb9f6c8234a52c4229fc5debe0a82f blob - d3283c409607632e6832eeae310b43f122ea16ba blob + 8d8ebb693f81dbed4045da8fa1c57f90b2e362a2 --- libexec/got-fetch-http/got-fetch-http.c +++ libexec/got-fetch-http/got-fetch-http.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -218,7 +217,7 @@ http_parse_reply(struct bufio *bio, int *chunked, cons } if (verbose > 0) - fprintf(stderr, "%s: response: %s\n", getprogname(), line); + fprintf(stderr, "%s: response: %s", getprogname(), line); if ((cp = strchr(line, ' ')) == NULL) { warnx("malformed HTTP response"); @@ -364,8 +363,6 @@ get_refs(int https, const char *host, const char *port int chunked; int sock; int ret = -1; - int i, n; - long long t; if ((sock = dial(https, host, port)) == -1) return -1; @@ -416,50 +413,7 @@ get_refs(int https, const char *host, const char *port if (r == 0) break; - if (r < 4) - goto err; - fwrite(buf, 1, r, stdout); - - t = 0; - n = 0; - while (n + 4 <= r) { - buf[n + 4] = '\0'; - t = hexstrtonum(&buf[n], 0, sizeof(buf) - n, &errstr); - if (errstr != NULL) { - fprintf(stderr, "pktline len is %s", errstr); - goto err; - } - - if (t == 0) { - if (verbose) { - fprintf(stderr, "%s: readpkt: 0000\n", - getprogname()); - } - break; - } - - if (t < 6) { - fprintf(stderr, "pktline len is too small"); - goto err; - } - - if (verbose) { - fprintf(stderr, "%s: readpkt: %lld:\t", - getprogname(), t - 4); - for (i = 5; i < t; i++) { - if (isprint((unsigned char)buf[n + i])) - fputc(buf[n + i], stderr); - else - fprintf(stderr, "[0x%.2x]", - buf[n + i]); - } - fputc('\n', stderr); - } - n += t; - } - if (t == 0) - break; } fflush(stdout); @@ -535,19 +489,6 @@ upload_request(int https, const char *host, const char if (r != t - 4) goto err; - if (verbose) { - int i; - fprintf(stderr, "%s: writepkt: %.4x:\t", - getprogname(), (unsigned int)t); - for (i = 4; i < t; i++) { - if (isprint((unsigned char)buf[i])) - fputc(buf[i], stderr); - else - fprintf(stderr, "[0x%.2x]", buf[i]); - } - fputc('\n', stderr); - } - if (http_chunk(&bio, buf, t)) goto err; }