| 368 | } |
| 369 | |
| 370 | static int show_http_message(struct strbuf *type, struct strbuf *charset, |
| 371 | struct strbuf *msg) |
| 372 | { |
| 373 | const char *p, *eol; |
| 374 | |
| 375 | /* |
| 376 | * We only show text/plain parts, as other types are likely |
| 377 | * to be ugly to look at on the user's terminal. |
| 378 | */ |
| 379 | if (strcmp(type->buf, "text/plain")) |
| 380 | return -1; |
| 381 | if (charset->len) |
| 382 | strbuf_reencode(msg, charset->buf, get_log_output_encoding()); |
| 383 | |
| 384 | strbuf_trim(msg); |
| 385 | if (!msg->len) |
| 386 | return -1; |
| 387 | |
| 388 | p = msg->buf; |
| 389 | do { |
| 390 | eol = strchrnul(p, '\n'); |
| 391 | fprintf(stderr, "remote: %.*s\n", (int)(eol - p), p); |
| 392 | p = eol + 1; |
| 393 | } while(*eol); |
| 394 | return 0; |
| 395 | } |
| 396 | |
| 397 | static int get_protocol_http_header(enum protocol_version version, |
| 398 | struct strbuf *header) |
no test coverage detected