if (debug) log_d("add_fd: %d %s", fd, filename);
static int add_fd(struct request *r, const char *filename){	int fd;	struct stat s;	if (filename == 0)		return -1;	if (get_mime(r, filename) == -1)		return -1;	if (r->class != CLASS_FILE)		return -1;	fd = open(filename, O_RDONLY | O_NONBLOCK);	if (fd == -1)		return -1;	if (fstat(fd, &s) == -1) {		lerror("fstat");		close(fd);		return -1;	}	if (!S_ISREG(s.st_mode)) {		log_d("non-plain file %s", filename);		close(fd);		return -1;	}	fcntl(fd, F_SETFD, FD_CLOEXEC);	r->cn->rfd = fd;	r->content_length = s.st_size;	return 0;}