summaryrefslogtreecommitdiff
path: root/http-backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'http-backend.c')
-rw-r--r--http-backend.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/http-backend.c b/http-backend.c
index b329bf63f0..807fb8839e 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -466,9 +466,7 @@ static void run_service(const char **argv, int buffer_input)
struct child_process cld = CHILD_PROCESS_INIT;
ssize_t req_len = get_content_length();
- if (encoding && !strcmp(encoding, "gzip"))
- gzipped_request = 1;
- else if (encoding && !strcmp(encoding, "x-gzip"))
+ if (encoding && (!strcmp(encoding, "gzip") || !strcmp(encoding, "x-gzip")))
gzipped_request = 1;
if (!user || !*user)
@@ -482,7 +480,7 @@ static void run_service(const char **argv, int buffer_input)
strvec_pushf(&cld.env_array,
"GIT_COMMITTER_EMAIL=%s@http.%s", user, host);
- cld.argv = argv;
+ strvec_pushv(&cld.args, argv);
if (buffer_input || gzipped_request || req_len >= 0)
cld.in = -1;
cld.git_cmd = 1;
@@ -534,7 +532,7 @@ static void get_info_refs(struct strbuf *hdr, char *arg)
if (service_name) {
const char *argv[] = {NULL /* service name */,
- "--stateless-rpc", "--advertise-refs",
+ "--http-backend-info-refs",
".", NULL};
struct rpc_service *svc = select_service(hdr, service_name);
@@ -661,8 +659,9 @@ static NORETURN void die_webcgi(const char *err, va_list params)
{
if (dead <= 1) {
struct strbuf hdr = STRBUF_INIT;
+ report_fn die_message_fn = get_die_message_routine();
- vreportf("fatal: ", err, params);
+ die_message_fn(err, params);
http_status(&hdr, 500, "Internal Server Error");
hdr_nocache(&hdr);
@@ -739,6 +738,7 @@ static int bad_request(struct strbuf *hdr, const struct service_cmd *c)
int cmd_main(int argc, const char **argv)
{
char *method = getenv("REQUEST_METHOD");
+ const char *proto_header;
char *dir;
struct service_cmd *cmd = NULL;
char *cmd_arg = NULL;
@@ -789,6 +789,9 @@ int cmd_main(int argc, const char **argv)
http_config();
max_request_buffer = git_env_ulong("GIT_HTTP_MAX_REQUEST_BUFFER",
max_request_buffer);
+ proto_header = getenv("HTTP_GIT_PROTOCOL");
+ if (proto_header)
+ setenv(GIT_PROTOCOL_ENVIRONMENT, proto_header, 0);
cmd->imp(&hdr, cmd_arg);
return 0;