static NORETURN void die_webcgi(const char *err, va_list params)
{
- char buffer[1000];
+ static int dead;
- http_status(500, "Internal Server Error");
- hdr_nocache();
- end_headers();
+ if (!dead) {
+ char buffer[1000];
+ dead = 1;
- vsnprintf(buffer, sizeof(buffer), err, params);
- fprintf(stderr, "fatal: %s\n", buffer);
- exit(0);
+ vsnprintf(buffer, sizeof(buffer), err, params);
+ fprintf(stderr, "fatal: %s\n", buffer);
+ http_status(500, "Internal Server Error");
+ hdr_nocache();
+ end_headers();
+ }
+ exit(0); /* we successfully reported a failure ;-) */
}
static char* getdir(void)
setup_path();
if (!enter_repo(dir, 0))
not_found("Not a git repository: '%s'", dir);
+ if (!getenv("GIT_HTTP_EXPORT_ALL") &&
+ access("git-daemon-export-ok", F_OK) )
+ not_found("Repository not exported: '%s'", dir);
git_config(http_config, NULL);
cmd->imp(cmd_arg);