commit 29460ff0cab862cacf5ec17a35c653e83ffff229 from: Stefan Sperling via: Thomas Adam date: Thu Apr 25 14:57:36 2024 UTC improve got-fetch-http request/response logging in verbose mode commit - cda0eee6bf5beb6465d01eda8542f8c3a4bbce7c commit + 29460ff0cab862cacf5ec17a35c653e83ffff229 blob - 4ef081a3cb94b0823e86ad6cb1142cabd0226c3b blob + 43382658e0e06dbf79a48f9353be18accc090566 --- libexec/got-fetch-http/got-fetch-http.c +++ libexec/got-fetch-http/got-fetch-http.c @@ -229,7 +229,7 @@ http_open(int https, const char *method, const char *h err(1, "asprintf"); if (verbose > 0) - fprintf(stderr, "%s: %s", getprogname(), req); + fprintf(stderr, "%s: request: %s", getprogname(), req); if (fwrite(req, 1, r, fp) != r) { free(req); @@ -255,6 +255,9 @@ http_parse_reply(FILE *fp, int *chunked, const char *e return -1; } + if (verbose > 0) + fprintf(stderr, "%s: response: %s", getprogname(), line); + if ((cp = strchr(line, '\r')) == NULL) { warnx("malformed HTTP response"); goto err;