if (p->script_input.end == p->script_input.ceiling) pollfds[p->rpollindex].events &= ~POLLIN;
static int readfromchild(struct connection *p){	size_t bytestoread;	ssize_t r;	bytestoread = p->script_input.ceiling - p->script_input.end;	if (p->pipe_params.haslen && bytestoread > p->pipe_params.pmax)		bytestoread = p->pipe_params.pmax;	if (bytestoread == 0) {		log_d("readfromchild: bytestoread is zero!");		return 0;	}	r = recv(p->rfd, p->script_input.end, bytestoread, 0);	if (debug)		log_d("readfromchild: %d %d %d %d", p->rfd, p->script_input.end - p->script_input.floor, bytestoread, r);	switch (r) {	case -1:		if (errno == EAGAIN)			return 0;		lerror("readfromchild");		close_connection(p);		return -1;	case 0:		if (p->pipe_params.state != 2) {			log_d("readfromchild: premature end of script headers (ipp=%d)", p->script_input.end - p->script_input.floor);			cgi_error(p->r);			return -1;		}		if (p->pipe_params.haslen) {			log_d("readfromchild: script went away (pmax=%d)", p->pipe_params.pmax);			close_connection(p);			return -1;		}		p->t = current_time;		p->script_input.state = 2;		break;	default:		p->t = current_time;		p->script_input.end += r;		if (p->pipe_params.haslen) {			p->pipe_params.pmax -= r;			if (p->pipe_params.pmax == 0)				p->script_input.state = 2;		}		break;	}	return 0;}