MCPcopy Create free account
hub / github.com/git/git / service_rpc

Function service_rpc

http-backend.c:654–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652}
653
654static 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
682static int dead;
683static NORETURN void die_webcgi(const char *err, va_list params)

Callers

nothing calls this directly

Calls 10

select_serviceFunction · 0.85
strvec_pushFunction · 0.85
strbuf_addfFunction · 0.85
check_content_typeFunction · 0.85
hdr_nocacheFunction · 0.85
hdr_strFunction · 0.85
end_headersFunction · 0.85
strbuf_releaseFunction · 0.85
strvec_clearFunction · 0.85
run_serviceFunction · 0.70

Tested by

no test coverage detected