} else
} else { if (debug) log_d("range covered entire file");
static int process_fd(struct request *r){	int fd;	if (r->path_args[0] && r->c->path_args_ok == 0 && (r->path_args[1] || r->isindex == 0)) {		r->error_file = r->c->error_404_file;		r->status = 404;		return 1;	}	if (r->method == M_POST) {		r->status = 405;		return 0;	}	fd = open(r->path_translated, O_RDONLY | O_NONBLOCK);	if (debug)		log_d("process_fd: %d %s", fd, r->path_translated);	if (fd == -1) {		log_d("cannot open %s", r->path_translated);		lerror("open");		r->error_file = r->c->error_404_file;		r->status = 404;		return 1;	}	if (fstat(fd, &r->finfo) == -1) {		lerror("fstat");		close(fd);		r->status = 500;		return 0;	}	if (!S_ISREG(r->finfo.st_mode)) {		log_d("process_fd: non-regular file %s", r->path_translated);		close(fd);		r->error_file = r->c->error_404_file;		r->status = 404;		return 1;	}	r->content_length = r->finfo.st_size;	if (r->status == 0) {		r->last_modified = r->finfo.st_mtime;		if (r->last_modified <= r->ims) {			close(fd);			r->num_content = -1;			r->status = 304;			return 0;		}		if (r->ius && r->last_modified > r->ius) {			close(fd);			r->status = 412;			return 0;		}		if (r->range == 0)			r->status = 200;		else {			if (satisfy_range(r) == -1) {				close(fd);				r->status = 416;				return 0;			}			if (r->range) {				if (r->range_floor)					lseek(fd, r->range_floor, SEEK_SET);				r->content_length = r->range_ceiling - r->range_floor + 1;				r->status = 206;			} else				r->status = 200;		}	}	if (r->method == M_GET) {		fcntl(fd, F_SETFD, FD_CLOEXEC);		r->cn->rfd = fd;	} else		close(fd);	return 0;}