| 652 | } |
| 653 | |
| 654 | static void service_rpc(struct strbuf *hdr, char *service_name) |
| 655 | { |
| 656 | struct strvec argv = STRVEC_INIT; |
| 657 | struct rpc_service *svc = select_service(hdr, service_name); |
| 658 | struct strbuf buf = STRBUF_INIT; |
| 659 | |
| 660 | strvec_push(&argv, svc->name); |
| 661 | if (strcmp(service_name, "git-upload-archive")) |
| 662 | strvec_push(&argv, "--stateless-rpc"); |
| 663 | strvec_push(&argv, "."); |
| 664 | |
| 665 | strbuf_reset(&buf); |
| 666 | strbuf_addf(&buf, "application/x-git-%s-request", svc->name); |
| 667 | check_content_type(hdr, buf.buf); |
| 668 | |
| 669 | hdr_nocache(hdr); |
| 670 | |
| 671 | strbuf_reset(&buf); |
| 672 | strbuf_addf(&buf, "application/x-git-%s-result", svc->name); |
| 673 | hdr_str(hdr, content_type, buf.buf); |
| 674 | |
| 675 | end_headers(hdr); |
| 676 | |
| 677 | run_service(argv.v, svc->buffer_input); |
| 678 | strbuf_release(&buf); |
| 679 | strvec_clear(&argv); |
| 680 | } |
| 681 | |
| 682 | static int dead; |
| 683 | static NORETURN void die_webcgi(const char *err, va_list params) |
nothing calls this directly
no test coverage detected