if (debug) log_d("D process_path");
static int process_path(struct request *r){	int rv;	if (debug)		log_d("D process_path");	switch (find_vs(r)) {	case -1:		return 500;	case 1:		return 404;	}	if ((r->c = faketoreal(r->path, r->path_translated, r, 1)) == 0)		return 500;	if (r->c->accesses && evaluate_access(r->cn->peer.sin_addr.s_addr, r->c->accesses) == DENY) {		r->error_file = r->c->error_403_file;		return 403;	}	if (r->c->realm && check_realm(r) == -1) {		r->error_file = r->c->error_401_file;		return 401;	}	if (r->path_translated[0] == 0)		return 500;	if (r->path_translated[0] != '/') {		escape_url(r->path_translated, r->newloc);		r->location = r->newloc;		return 302;	}	if (check_path(r) == -1) {		r->error_file = r->c->error_404_file;		return 404;	}	if (get_path_info(r) == -1)		return 500;	if (S_ISDIR(r->finfo.st_mode)) {		if (r->path_args[0] != '/')			return makedir(r);		rv = append_indexes(r);		if (rv)			return rv;	}	if (!S_ISREG(r->finfo.st_mode)) {		log_d("%s is not a regular file", r->path_translated);		r->error_file = r->c->error_404_file;		return 404;	}	if (get_mime(r, r->path_translated) == -1) {		r->error_file = r->c->error_404_file;		return 404;	}	switch (r->class) {	case CLASS_FILE:		return process_fd(r);	case CLASS_SPECIAL:		return process_special(r);	case CLASS_EXTERNAL:		return process_external(r);	}	log_d("unknown class!?");	return 500;}