if (debug) log_d("process_request finished (s=%d)", s);
int process_request(struct request *r){	int s, n;	s = process_headers(r);	switch (s) {	case -1:		return -1;	case 0:		break;	default:		s = process_path(r);		if (s != 1)			break;		n = 0;		do {			if (r->error_file) {				r->location_length = sprintf(r->path_translated, "%.*s", PATHLEN - 1, r->error_file);				r->error_file = 0;			}			if (debug)				log_d("process_request: %s", r->path_translated);			s = process_path_translated(r);		} while (++n < 3 && s == 1 && r->error_file);		if (n == 3 && s == 1) {			log_d("process_request: loop detected");			r->status = 500;		}	}	if (r->status)		if (prepare_reply(r) == -1) {			log_d("cannot prepare reply for client");			return -1;		}	return s >= 0 ? 0 : -1;}